Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[37274] Remove accessibleClick (#9355)

Oliver Günther46599dd90e74
diff --git a/frontend/src/app/core/global_search/input/global-search-input-mobile.component.sass b/frontend/src/app/core/global_search/input/global-search-input-mobile.component.sass
index 1080c76ba48..23096d1367d 100644
--- a/frontend/src/app/core/global_search/input/global-search-input-mobile.component.sass
+++ b/frontend/src/app/core/global_search/input/global-search-input-mobile.component.sass
@@ -4,7 +4,7 @@ $search-input-height-mobile: 36px
@media only screen and (max-width: 679px)
.top-menu-search
- #global-search-input
+ &--input
display: none
&.-expanded
display: block
@@ -33,6 +33,7 @@ $search-input-height-mobile: 36px
height: 36px
.top-menu-search--back-button
+ @include unset-button-styles
display: initial
width: 50px
text-align: center
diff --git a/frontend/src/app/core/global_search/input/global-search-input.component.html b/frontend/src/app/core/global_search/input/global-search-input.component.html
index fbf352560c1..bef38ad8a1c 100644
--- a/frontend/src/app/core/global_search/input/global-search-input.component.html
+++ b/frontend/src/app/core/global_search/input/global-search-input.component.html
@@ -1,5 +1,5 @@
<div class="top-menu-search">
- <a
+ <button
*ngIf="expanded"
(click)="toggleMobileSearch()"
class="top-menu-search--back-button"
@@ -7,7 +7,7 @@
title="{{text.close_search}}"
>
<i class="icon-arrow-left1" aria-hidden="true"></i>
- </a>
+ </button>
<op-autocompleter
#select
@@ -62,10 +62,7 @@
<div class="global-search--wp-content">
<span [textContent]="item.project" class="global-search--wp-project"></span>
- <a
- class="global-search--wp-id"
- [ngClass]="uiStateLinkClass"
- >#{{item.id}}</a>
+ #{{item.id}}
<span
[textContent]="item.status"
[ngClass]="statusHighlighting(item.statusId)"
@@ -78,16 +75,16 @@
</ng-template>
</op-autocompleter>
- <a
- #btn
- id="top-menu-search-button"
- class="top-menu-search--button search-form-normal"
- title="{{text.search}}"
- tabindex="0"
- role="button"
- [class.-input-focused]="expanded"
- (accessibleClick)="handleClick($event)"
+ <button
+ role="button"
+ #btn
+ id="top-menu-search-button"
+ class="top-menu-search--button search-form-normal"
+ title="{{text.search}}"
+ [class.-input-focused]="expanded"
+ (click)="handleClick($event)"
+
>
<op-icon icon-classes="icon5 icon-search ellipsis"></op-icon>
- </a>
+ </button>
</div>
diff --git a/frontend/src/app/core/global_search/input/global-search-input.component.sass b/frontend/src/app/core/global_search/input/global-search-input.component.sass
index 7e2c800d9a7..18d091d978f 100644
--- a/frontend/src/app/core/global_search/input/global-search-input.component.sass
+++ b/frontend/src/app/core/global_search/input/global-search-input.component.sass
@@ -20,6 +20,7 @@ $search-input-height: 30px
display: none
&--button
+ @include unset-button-styles
position: absolute
right: 2px
font-size: var(--header-item-font-size)
@@ -48,7 +49,7 @@ $search-input-height: 30px
height: 46px // ng-option height + 1px border
z-index: 1051
- #global-search-input
+ &--input
width: $search-input-width
font-size: 0.9rem
-webkit-transition: width 0.2s ease-in-out
diff --git a/frontend/src/app/features/admin/editable-query-props/editable-query-props.component.html b/frontend/src/app/features/admin/editable-query-props/editable-query-props.component.html
index 3ee58733880..f7759f13624 100644
--- a/frontend/src/app/features/admin/editable-query-props/editable-query-props.component.html
+++ b/frontend/src/app/features/admin/editable-query-props/editable-query-props.component.html
@@ -2,8 +2,10 @@
[attr.name]="name || undefined"
[attr.id]="id || undefined"
[value]="queryProps"/>
-<a
- class="button--link"
- (accessibleClick)="editQuery()"
- [accessibleClickStopEvent]="true"
- [textContent]="text.edit_query"></a>
+<button
+ type="button"
+ class="op-link"
+ (click)="editQuery()"
+ [textContent]="text.edit_query"
+>
+</button>
diff --git a/frontend/src/app/features/admin/types/type-form-configuration.html b/frontend/src/app/features/admin/types/type-form-configuration.html
index ed876a5e87a..8c33d3e11fe 100644
--- a/frontend/src/app/features/admin/types/type-form-configuration.html
+++ b/frontend/src/app/features/admin/types/type-form-configuration.html
@@ -17,16 +17,22 @@
</a>
<ul class="menu-drop-down-container">
<li>
- <a class="form-configuration--add-group"
- [textContent]="text.add_group"
- (accessibleClick)="createGroup('attribute', '')">
- </a>
+ <button
+ type="button"
+ class="menu-item form-configuration--add-group"
+ [textContent]="text.add_group"
+ (click)="createGroup('attribute', '')"
+ >
+ </button>
</li>
<li>
- <a class="form-configuration--add-group"
- [textContent]="text.add_table"
- (accessibleClick)="addGroupAndOpenQuery()">
- </a>
+ <button
+ type="button"
+ class="menu-item form-configuration--add-group"
+ [textContent]="text.add_table"
+ (click)="addGroupAndOpenQuery()"
+ >
+ </button>
</li>
</ul>
</li>
diff --git a/frontend/src/app/features/boards/board/board-list/board-list.component.html b/frontend/src/app/features/boards/board/board-list/board-list.component.html
index 72423db3368..aaf159c84a9 100644
--- a/frontend/src/app/features/boards/board/board-list/board-list.component.html
+++ b/frontend/src/app/features/boards/board/board-list/board-list.component.html
@@ -58,9 +58,13 @@
<p>
<span [textContent]="errorMessage"></span>
&ngsp;
- <a role="button" (accessibleClick)="onRemove.emit()">
+ <buton
+ type="button"
+ class="op-link"
+ (click)="onRemove.emit()"
+ >
<span [textContent]="text.click_to_remove"></span>
- </a>
+ </buton>
</p>
</div>
</div>
diff --git a/frontend/src/app/features/boards/tile-view/tile-view.component.html b/frontend/src/app/features/boards/tile-view/tile-view.component.html
index 63d9b3460c6..e5f37dea89c 100644
--- a/frontend/src/app/features/boards/tile-view/tile-view.component.html
+++ b/frontend/src/app/features/boards/tile-view/tile-view.component.html
@@ -1,12 +1,15 @@
<div class="tile-blocks--container">
- <div class="tile-block button"
- [disabled]="disabled()"
- (accessibleClick)="created(tile.attribute)"
- *ngFor="let tile of tiles">
- <img [src]="tile.image" class="tile-block-image"/>
- <div>
- <span class="tile-block-title">{{ tile.text }}</span>
- <p class="tile-block-description" [textContent]="tile.description"></p>
- </div>
+ <button
+ *ngFor="let tile of tiles"
+ class="tile-block button"
+ type="button"
+ [disabled]="disabled()"
+ (click)="created(tile.attribute)"
+ >
+ <img [src]="tile.image" class="tile-block-image"/>
+ <div>
+ <span class="tile-block-title">{{ tile.text }}</span>
+ <p class="tile-block-description" [textContent]="tile.description"></p>
</div>
+ </button>
</div>
\ No newline at end of file
diff --git a/frontend/src/app/features/work-packages/components/wp-buttons/wp-button.template.html b/frontend/src/app/features/work-packages/components/wp-buttons/wp-button.template.html
index 77e00c11489..c425d34e96f 100644
--- a/frontend/src/app/features/work-packages/components/wp-buttons/wp-button.template.html
+++ b/frontend/src/app/features/work-packages/components/wp-buttons/wp-button.template.html
@@ -1,10 +1,10 @@
<button class="button {{ buttonClass }}"
type="button"
- [ngClass]="{ '-active': isActive }"
+ [class.-active]="isActive"
[disabled]="disabled || (!isToggle() && isActive)"
[attr.id]="buttonId"
[attr.title]="label"
[attr.accesskey]="accessKey"
- (accessibleClick)="performAction($event)">
+ (click)="performAction($event)">
<op-icon icon-classes="{{ iconClass }} button--icon"></op-icon>
</button>
diff --git a/frontend/src/app/features/work-packages/components/wp-card-view/wp-single-card/wp-single-card.component.html b/frontend/src/app/features/work-packages/components/wp-card-view/wp-single-card/wp-single-card.component.html
index 85a03929e64..5a789712176 100644
--- a/frontend/src/app/features/work-packages/components/wp-card-view/wp-single-card/wp-single-card.component.html
+++ b/frontend/src/app/features/work-packages/components/wp-card-view/wp-single-card/wp-single-card.component.html
@@ -6,21 +6,24 @@
</div>
<div class="wp-card--inline-buttons hidden-for-mobile">
- <a class="wp-card--details-button -no-decoration"
- *ngIf="!workPackage.isNew && showInfoButton"
- [title]="text.detailsView"
- (accessibleClick)="emitStateLinkClicked(workPackage, true)">
+ <button
+ type="button"
+ class="op-link wp-card--details-button"
+ *ngIf="!workPackage.isNew && showInfoButton"
+ [title]="text.detailsView"
+ (click)="emitStateLinkClicked($event, workPackage, true)">
<op-icon icon-classes="icon icon-info2"></op-icon>
- </a>
- <a class="wp-card--inline-cancel-button -no-decoration"
- *ngIf="workPackage.isNew || showRemoveButton"
- [ngClass]="{ '-show': workPackage.isNew }"
- [title]="text.removeCard"
- (accessibleClick)="onRemoved(workPackage)">
+ </button>
+ <button
+ class="op-link wp-card--inline-cancel-button"
+ *ngIf="workPackage.isNew || showRemoveButton"
+ [class.-show]="workPackage.isNew"
+ [title]="text.removeCard"
+ (click)="onRemoved(workPackage)">
<op-icon icon-classes="icon icon-close"></op-icon>
- </a>
+ </button>
</div>
- <edit-form [resource]="workPackage"
+ <edit-form [resource]="workPackage"
[inEditMode]="workPackage.isNew"
*ngIf="workPackage.isNew">
<div class="wp-card--content -new">
@@ -41,21 +44,21 @@
<span [textContent]="wpProjectName(workPackage)"
class="wp-card--project-name">
</span>
- <span [textContent]="wpTypeAttribute(workPackage)"
+ <span [textContent]="wpTypeAttribute(workPackage)"
class="wp-card--type"
[ngClass]="typeHighlightingClass(workPackage)">
</span>
<a class="wp-card--id"
[href]="fullWorkPackageLink(workPackage)"
[ngClass]="uiStateLinkClass"
- (accessibleClick)="emitStateLinkClicked(workPackage)"
- [accessibleClickSkipModifiers]="true">
+ (click)="emitStateLinkClicked($event, workPackage)"
+ >
#{{workPackage.id}}
</a>
<span [textContent]="wpSubject(workPackage)"
class="wp-card--subject">
</span>
- <img *ngIf="this.cardCoverImageShown(workPackage)"
+ <img *ngIf="this.cardCoverImageShown(workPackage)"
[src]="this.bcfSnapshotPath(workPackage)"
class="wp-card--cover-image">
<wp-status-button *ngIf="showStatusButton"
diff --git a/frontend/src/app/features/work-packages/components/wp-card-view/wp-single-card/wp-single-card.component.ts b/frontend/src/app/features/work-packages/components/wp-card-view/wp-single-card/wp-single-card.component.ts
index bb85933e3c8..8711b11dafd 100644
--- a/frontend/src/app/features/work-packages/components/wp-card-view/wp-single-card/wp-single-card.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-card-view/wp-single-card/wp-single-card.component.ts
@@ -19,6 +19,7 @@ import { CardViewOrientation } from "core-app/features/work-packages/components/
import { UntilDestroyedMixin } from "core-app/shared/helpers/angular/until-destroyed.mixin";
import { WorkPackageViewFocusService } from "core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-focus.service";
import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource";
+import { LinkHandling } from "core-app/shared/helpers/link-handling/link-handling";
@Component({
selector: 'wp-single-card',
@@ -71,7 +72,11 @@ export class WorkPackageSingleCardComponent extends UntilDestroyedMixin implemen
return this.cardView.classIdentifier(wp);
}
- public emitStateLinkClicked(wp:WorkPackageResource, detail?:boolean) {
+ public emitStateLinkClicked(event:MouseEvent, wp:WorkPackageResource, detail?:boolean):void {
+ if (LinkHandling.isClickedWithModifier(event)) {
+ return;
+ }
+
const classIdentifier = this.classIdentifier(wp);
const stateToEmit = detail ? 'split' : 'show';
diff --git a/frontend/src/app/features/work-packages/components/wp-inline-create/wp-inline-create.component.html b/frontend/src/app/features/work-packages/components/wp-inline-create/wp-inline-create.component.html
index 512bb2f8ccd..cc2a8ec252d 100644
--- a/frontend/src/app/features/work-packages/components/wp-inline-create/wp-inline-create.component.html
+++ b/frontend/src/app/features/work-packages/components/wp-inline-create/wp-inline-create.component.html
@@ -4,30 +4,30 @@
<td [attr.colspan]="colspan"
class="wp-inline-create-button-td -no-highlighting">
<div class="wp-inline-create-button">
- <a class="wp-inline-create--add-link"
- href
- role="link"
- [focus]="focus"
- *ngIf="canAdd"
- [ngClass]="{'wp-inline-create--split-link': hasReferenceClass }"
- (accessibleClick)="handleAddRowClick()"
- [attr.disabled]="!isAllowed || undefined"
- [attr.aria-label]="text.create"
- aria-haspopup="true">
+ <button
+ *ngIf="canAdd"
+ type="button"
+ class="wp-inline-create--add-link"
+ [class.wp-inline-create--split-link]="hasReferenceClass"
+ [focus]="focus"
+ (click)="handleAddRowClick()"
+ [attr.aria-label]="text.create"
+ aria-haspopup="true"
+ >
<op-icon icon-classes="icon icon-add"></op-icon>
<span [textContent]="text.create"></span>
- </a>
+ </button>
<ng-container *ngIf="canReference">
- <a class="wp-inline-create--reference-link wp-inline-create--split-link"
- href
- role="link"
- (accessibleClick)="handleReferenceClick()"
- [attr.disabled]="!isAllowed || undefined"
- [attr.aria-label]="text.create"
- aria-haspopup="true">
+ <button
+ type="button"
+ class="wp-inline-create--reference-link wp-inline-create--split-link"
+ (click)="handleReferenceClick()"
+ [attr.aria-label]="text.create"
+ aria-haspopup="true"
+ >
<op-icon icon-classes="icon icon-link"></op-icon>
<span [textContent]="text.reference"></span>
- </a>
+ </button>
</ng-container>
</div>
</td>
diff --git a/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html b/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html
index 590361d1dd9..69e2e460448 100644
--- a/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html
+++ b/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html
@@ -4,18 +4,18 @@
<div class="grid-block hierarchy-item">
<div class="grid-content medium-2 collapse">
- <span class="relation-row--type"
- (accessibleClick)="activateRelationTypeEdit()"
- tabindex="0"
- *ngIf="!userInputs.showRelationTypesForm">
-
+ <button
+ type="button"
+ class="relation-row--type"
+ (click)="activateRelationTypeEdit()"
+ *ngIf="!userInputs.showRelationTypesForm">
- <span *ngIf="groupByWorkPackageType"
- [textContent]="normalizedRelationType"></span>
- <span *ngIf="!groupByWorkPackageType"
- [textContent]="relatedWorkPackage.type.name"></span>
- <span class="hidden-for-sighted" [textContent]="text.updateRelation"></span>
- </span>
+ <span *ngIf="groupByWorkPackageType"
+ [textContent]="normalizedRelationType"></span>
+ <span *ngIf="!groupByWorkPackageType"
+ [textContent]="relatedWorkPackage.type.name"></span>
+ <span class="hidden-for-sighted" [textContent]="text.updateRelation"></span>
+ </button>
<div class="inline-edit--container inplace-edit"
*ngIf="userInputs.showRelationTypesForm">
<select class="inline-edit--field form--select"
@@ -50,45 +50,49 @@
<div class="grid-content medium-2 collapse wp-relations-controls-section"
ng-class="{'-expanded': userInputs.showRelationInfo }">
<button
- type="button"
- class="op-link wp-relations--description-btn"
- [ngClass]="{'-visible': showDescriptionInfo }"
- [title]="text.description_label"
- (click)="userInputs.showRelationInfo = !userInputs.showRelationInfo"
+ type="button"
+ class="op-link wp-relations--description-btn"
+ [ngClass]="{'-visible': showDescriptionInfo }"
+ [title]="text.description_label"
+ (click)="userInputs.showRelationInfo = !userInputs.showRelationInfo"
>
<op-icon icon-classes="icon-info1 icon-no-color -padded wp-relations--icon wp-relations--description-icon"
[icon-title]="text.toggleDescription"></op-icon>
</button>
<button
- *ngIf="!!relation.delete"
- type="button"
- class="op-link relation-row--remove-btn"
- [ngClass]="{'-visible': showDescriptionInfo }"
- [title]="text.removeButton"
- (click)="removeRelation()"
+ *ngIf="!!relation.delete"
+ type="button"
+ class="op-link relation-row--remove-btn"
+ [ngClass]="{'-visible': showDescriptionInfo }"
+ [title]="text.removeButton"
+ (click)="removeRelation()"
>
- <op-icon icon-classes="icon-remove icon-no-color -padded wp-relations--icon" [icon-title]="text.removeButton"></op-icon>
+ <op-icon icon-classes="icon-remove icon-no-color -padded wp-relations--icon"
+ [icon-title]="text.removeButton"></op-icon>
</button>
</div>
</div>
<div class="grid-block hierarchy-item description-container"
*ngIf="userInputs.showRelationInfo">
- <div class="wp-relation--description-read-value"
- [ngClass]="{'-placeholder': !relation.description }"
- (accessibleClick)="startDescriptionEdit()"
- *ngIf="!userInputs.showDescriptionEditForm"
- [textContent]="relation.description || text.placeholder.description">
- </div>
+ <button
+ *ngIf="!userInputs.showDescriptionEditForm"
+ type="button"
+ class="wp-relation--description-read-value"
+ [class.-placeholder]="!relation.description"
+ (click)="startDescriptionEdit()"
+ [textContent]="relation.description || text.placeholder.description"
+ >
+ </button>
<div class="wp-relation--description-wrapper textarea-wrapper"
*ngIf="userInputs.showDescriptionEditForm">
<textarea
- #relationDescriptionTextarea
- autofocus
- class="wp-relation--description-textarea"
- name="description"
- (keyup)="handleDescriptionKey($event)"
- [(ngModel)]="userInputs.newRelationText"></textarea>
+ #relationDescriptionTextarea
+ autofocus
+ class="wp-relation--description-textarea"
+ name="description"
+ (keyup)="handleDescriptionKey($event)"
+ [(ngModel)]="userInputs.newRelationText"></textarea>
<edit-field-controls [fieldController]="fieldController"
(onSave)="saveDescription()"
(onCancel)="cancelDescriptionEdit()"
diff --git a/frontend/src/app/features/work-packages/components/wp-relations/wp-relations-create/wp-relation-create.template.html b/frontend/src/app/features/work-packages/components/wp-relations/wp-relations-create/wp-relation-create.template.html
index 631bfd49488..847fbb319dd 100644
--- a/frontend/src/app/features/work-packages/components/wp-relations/wp-relations-create/wp-relation-create.template.html
+++ b/frontend/src/app/features/work-packages/components/wp-relations/wp-relations-create/wp-relation-create.template.html
@@ -3,14 +3,16 @@
*ngIf="!showRelationsCreateForm">
<div class="grid-block">
<div class="grid-content collapse wp-inline-create-button">
- <a class="wp-inline-create--add-link relation-create"
- autoFocus
- (accessibleClick)="toggleRelationsCreateForm()"
- href
- id="relation--add-relation">
+ <button
+ type="button"
+ class="op-link wp-inline-create--add-link relation-create"
+ autoFocus
+ (click)="toggleRelationsCreateForm()"
+ id="relation--add-relation"
+ >
<op-icon icon-classes="icon icon-add"></op-icon>
<span [textContent]="text.addNewRelation"></span>
- </a>
+ </button>
</div>
</div>
</div>
@@ -34,18 +36,18 @@
</div>
<div class="grid-content medium-8">
<wp-relations-autocomplete
- [workPackage]="workPackage"
- (onSelected)="onSelected($event)"
- (onCancel)="toggleRelationsCreateForm()"
- [hiddenOverflowContainer]="'.work-packages-tab-view--overflow'"
- [selectedRelationType]="selectedRelationType">
+ [workPackage]="workPackage"
+ (onSelected)="onSelected($event)"
+ (onCancel)="toggleRelationsCreateForm()"
+ [hiddenOverflowContainer]="'.work-packages-tab-view--overflow'"
+ [selectedRelationType]="selectedRelationType">
</wp-relations-autocomplete>
</div>
<div class="grid-content medium-1 collapse wp-relations-controls-section relation-row">
<button
- type="button"
- class="op-link wp-create-relation--cancel"
- (click)="toggleRelationsCreateForm()"
+ type="button"
+ class="op-link wp-create-relation--cancel"
+ (click)="toggleRelationsCreateForm()"
>
<op-icon icon-classes="icon-remove icon-no-color -padded" [icon-title]="text.abort"></op-icon>
</button>
diff --git a/frontend/src/app/features/work-packages/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts b/frontend/src/app/features/work-packages/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts
index 6f5ecf0a72a..8ee4b204255 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts
+++ b/frontend/src/app/features/work-packages/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts
@@ -141,7 +141,7 @@ describe('wpTablePagination Directive', () => {
const element = jQuery(fixture.elementRef.nativeElement);
function numberOfPageNumberLinks() {
- return element.find('a[rel="next"]').length;
+ return element.find('button[rel="next"]').length;
}
app.pagination = new PaginationInstance(1, 1, 10);
diff --git a/frontend/src/app/shared/components/attachments/attachments-upload/attachments-upload.html b/frontend/src/app/shared/components/attachments/attachments-upload/attachments-upload.html
index 3f71071abbd..f03065544ee 100644
--- a/frontend/src/app/shared/components/attachments/attachments-upload/attachments-upload.html
+++ b/frontend/src/app/shared/components/attachments/attachments-upload/attachments-upload.html
@@ -11,17 +11,19 @@
name="attachment_files"
(change)="onFilePickerChanged()"
hidden
- multiple />
- <div class="work-package--attachments--drop-box"
- tabindex="0"
- (accessibleClick)="triggerFileInput($event)"
- [ngClass]="{ '-dragging': draggingOver }">
- <div class="work-package--attachments--label">
+ multiple/>
+ <button
+ type="button"
+ class="work-package--attachments--drop-box"
+ (click)="triggerFileInput($event)"
+ [class.-dragging]="draggingOver"
+ >
+ <span class="work-package--attachments--label">
<op-icon icon-classes="icon-attachment"></op-icon>
<label for="attachment_files">
{{ text.dropFiles }} <br>
{{ text.dropFilesHint }}
</label>
- </div>
- </div>
+ </span>
+ </button>
</div>
diff --git a/frontend/src/app/shared/components/editable-toolbar-title/editable-toolbar-title.html b/frontend/src/app/shared/components/editable-toolbar-title/editable-toolbar-title.html
index 0038024651d..7494bf5881a 100644
--- a/frontend/src/app/shared/components/editable-toolbar-title/editable-toolbar-title.html
+++ b/frontend/src/app/shared/components/editable-toolbar-title/editable-toolbar-title.html
@@ -1,14 +1,14 @@
<div *ngIf="editable"
(focusout)="saveWhenFocusOutside($event)"
class="editable-toolbar-title--container">
- <a *ngIf="showSave"
- role="link"
- class="editable-toolbar-title--save"
- (accessibleClick)="save($event, true)"
- [attr.aria-label]="text.query_has_changed_click_to_save"
- [attr.title]="text.query_has_changed_click_to_save">
- <span aria-hidden="true" class="icon icon-save"></span>
- </a>
+ <button
+ *ngIf="showSave"
+ type="button"
+ class="op-link editable-toolbar-title--save"
+ (click)="save($event, true)"
+ [attr.title]="text.query_has_changed_click_to_save">
+ <op-icon icon-classes="icon icon-save icon-no-color"></op-icon>
+ </button>
<input #editableTitleInput
size="1"
type="text"
@@ -28,7 +28,8 @@
<!-- This is not an angular component, rather it is a custom element so the specificity of the css stays low.
The &nbsp;&nbsp; is for making sure that the shim is always a bit larger than the input. Sometimes the ellipsis
would kick in to early otherwise. -->
- <input-shim class="editable-toolbar-title--input editable-toolbar-title--input-shim toolbar--editable-toolbar">{{ selectedTitle || text.input_placeholder }}{{ selectedTitle ? '&nbsp;&nbsp;' : ''}}</input-shim>
+ <input-shim
+ class="editable-toolbar-title--input editable-toolbar-title--input-shim toolbar--editable-toolbar">{{ selectedTitle || text.input_placeholder }}{{ selectedTitle ? '&nbsp;&nbsp;' : ''}}</input-shim>
</div>
<h2 *ngIf="!editable"
[attr.title]="selectedTitle"
diff --git a/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.html b/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.html
index d0156199676..88436ad2a71 100644
--- a/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.html
+++ b/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.html
@@ -10,8 +10,8 @@
[hidden]="!active">
</div>
- <div (accessibleClick)="activateIfEditable($event)"
- [accessibleClickStopEvent]="false"
+ <div (click)="activateIfEditable($event)"
+ (keydown.enter)="activateIfEditable($event)"
[hidden]="active"
tabindex="-1"
#displayContainer></div>
diff --git a/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.ts b/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.ts
index 9ee5dc5c24f..0458e5ada47 100644
--- a/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.ts
+++ b/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.ts
@@ -56,6 +56,7 @@ import {
editFieldContainerClass
} from "core-app/shared/components/fields/display/display-field-renderer";
import { States } from "core-app/core/states/states.service";
+import ClickEvent = JQuery.ClickEvent;
@Component({
selector: 'editable-attribute-field',
@@ -152,15 +153,15 @@ export class EditableAttributeFieldComponent extends UntilDestroyedMixin impleme
return this.editForm && this.schema.isAttributeEditable(this.fieldName);
}
- public activateIfEditable(event:JQuery.TriggeredEvent) {
+ public activateIfEditable(event:MouseEvent|KeyboardEvent) {
// Ignore selections
- if (SelectionHelpers.hasSelectionWithin(event.target)) {
+ if (SelectionHelpers.hasSelectionWithin(event.target as HTMLElement)) {
debugLog(`Not activating ${this.fieldName} because of active selection within`);
return true;
}
// Skip activation if the user clicked on a link or within a macro
- const target = jQuery(event.target);
+ const target = jQuery(event.target as HTMLElement);
if (target.closest('a,macro', this.displayContainer.nativeElement).length > 0) {
return true;
}
@@ -185,10 +186,10 @@ export class EditableAttributeFieldComponent extends UntilDestroyedMixin impleme
.catch(() => this.deactivate(true));
}
- public handleUserActivate(evt:JQuery.TriggeredEvent|null) {
+ public handleUserActivate(evt:MouseEvent|KeyboardEvent|null) {
let positionOffset = 0;
- if (evt) {
+ if (evt?.type === 'click') {
// Get the position where the user clicked.
positionOffset = ClickPositionMapper.getPosition(evt);
}
diff --git a/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text.component.html b/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text.component.html
index 10540554926..7a1f9087c83 100644
--- a/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text.component.html
+++ b/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text.component.html
@@ -1,10 +1,10 @@
<widget-header
- [name]="widgetName"
- (onRenamed)="renameWidget($event)">
+ [name]="widgetName"
+ (onRenamed)="renameWidget($event)">
<widget-menu
- slot="menu"
- [resource]="resource">
+ slot="menu"
+ [resource]="resource">
</widget-menu>
</widget-header>
@@ -12,11 +12,11 @@
<span #displayContainer
class="inline-edit--formattable-display-text -default">
<div class="op-uc-container"
- *ngIf="!textEmpty"
- [innerHTML]="customText"></div>
+ *ngIf="!textEmpty"
+ [innerHTML]="customText"></div>
<div
- *ngIf="textEmpty"
- [innerHTML]="placeholderText"></div>
+ *ngIf="textEmpty"
+ [innerHTML]="placeholderText"></div>
</span>
</ng-template>
@@ -35,13 +35,14 @@
<div *ngIf="!active"
class="inplace-edit--read wiki -no-label"
[ngClass]="{'inline-edit--container': isTextEditable}">
- <div *ngIf="isTextEditable"
- (accessibleClick)="activate($event)"
- [accessibleClickStopEvent]="false"
- [ngClass]="inplaceEditClasses">
-
+ <button
+ type="button"
+ *ngIf="isTextEditable"
+ (click)="activate($event)"
+ [ngClass]="inplaceEditClasses"
+ >
<ng-container *ngTemplateOutlet="text"></ng-container>
- </div>
+ </button>
<ng-container *ngIf="!isTextEditable">
<ng-container *ngTemplateOutlet="text"></ng-container>
diff --git a/frontend/src/app/shared/components/op-context-menu/op-context-menu.component.ts b/frontend/src/app/shared/components/op-context-menu/op-context-menu.component.ts
index a91a6bf32a3..c600dd26e25 100644
--- a/frontend/src/app/shared/components/op-context-menu/op-context-menu.component.ts
+++ b/frontend/src/app/shared/components/op-context-menu/op-context-menu.component.ts
@@ -17,15 +17,15 @@ export class OPContextMenuComponent {
this.service = this.locals.service;
}
- public handleClick(item:OpContextMenuItem, $event:JQuery.TriggeredEvent) {
+ public handleClick(item:OpContextMenuItem, event:MouseEvent) {
if (item.disabled || item.divider) {
return false;
}
- if (item.onClick!($event)) {
+ if (item.onClick!(event)) {
this.locals.service.close();
- $event.preventDefault();
- $event.stopPropagation();
+ event.preventDefault();
+ event.stopPropagation();
return false;
}
diff --git a/frontend/src/app/shared/components/op-context-menu/op-context-menu.html b/frontend/src/app/shared/components/op-context-menu/op-context-menu.html
index a8aa0c37766..02ba155d85d 100644
--- a/frontend/src/app/shared/components/op-context-menu/op-context-menu.html
+++ b/frontend/src/app/shared/components/op-context-menu/op-context-menu.html
@@ -7,20 +7,37 @@
<ng-container *ngFor="let item of items">
<li *ngIf="item.divider" class="dropdown-divider"></li>
<li *ngIf="!item.divider">
- <a class="menu-item {{ item.class }}"
- tabindex="0"
- [ngClass]="{ 'inactive': item.disabled }"
- [attr.href]="item.href || ''"
- [attr.aria-disabled]="item.disabled"
- [attr.aria-label]="item.ariaLabel || item.linkText"
- (accessibleClick)="handleClick(item, $event)"
- [accessibleClickStopEvent]="false">
- <op-icon *ngIf="item.icon" icon-classes="icon-action-menu {{ item.icon }}"> </op-icon>
+ <a
+ *ngIf="item.href"
+ class="menu-item"
+ [ngClass]="item.class"
+ [class.inacive]="item.disabled"
+ [attr.href]="item.href"
+ [attr.aria-disabled]="item.disabled"
+ [attr.aria-label]="item.ariaLabel || item.linkText"
+ (click)="handleClick(item, $event)"
+ >
+ <op-icon *ngIf="item.icon" icon-classes="icon-action-menu {{ item.icon }}"></op-icon>
<span [textContent]="item.linkText"></span>
<op-icon *ngIf="item.postIcon"
[icon-title]="item.postIconTitle || ''"
- icon-classes="icon-action-menu-post {{ item.postIcon }}"> </op-icon>
+ icon-classes="icon-action-menu-post {{ item.postIcon }}"></op-icon>
</a>
+ <button
+ *ngIf="!item.href"
+ class="menu-item"
+ [ngClass]="item.class"
+ [class.inacive]="item.disabled"
+ [attr.aria-disabled]="item.disabled"
+ [attr.aria-label]="item.ariaLabel || item.linkText"
+ (click)="handleClick(item, $event)"
+ >
+ <op-icon *ngIf="item.icon" icon-classes="icon-action-menu {{ item.icon }}"></op-icon>
+ <span [textContent]="item.linkText"></span>
+ <op-icon *ngIf="item.postIcon"
+ [icon-title]="item.postIconTitle || ''"
+ icon-classes="icon-action-menu-post {{ item.postIcon }}"></op-icon>
+ </button>
</li>
</ng-container>
</ul>
diff --git a/frontend/src/app/shared/components/op-context-menu/op-context-menu.types.ts b/frontend/src/app/shared/components/op-context-menu/op-context-menu.types.ts
index 1ce894d5665..107cb298e00 100644
--- a/frontend/src/app/shared/components/op-context-menu/op-context-menu.types.ts
+++ b/frontend/src/app/shared/components/op-context-menu/op-context-menu.types.ts
@@ -17,5 +17,5 @@ export interface OpContextMenuItem {
ariaLabel?:string;
linkText?:string;
divider?:boolean;
- onClick?:($event:JQuery.TriggeredEvent) => boolean;
+ onClick?:($event:JQuery.TriggeredEvent|MouseEvent) => boolean;
}
diff --git a/frontend/src/app/shared/components/resizer/resizer/main-menu-resizer.component.ts b/frontend/src/app/shared/components/resizer/resizer/main-menu-resizer.component.ts
index 989a8607a5d..6a79218ad78 100644
--- a/frontend/src/app/shared/components/resizer/resizer/main-menu-resizer.component.ts
+++ b/frontend/src/app/shared/components/resizer/resizer/main-menu-resizer.component.ts
@@ -44,16 +44,16 @@ export const mainMenuResizerSelector = 'main-menu-resizer';
(start)="resizeStart()"
(move)="resizeMove($event)">
<div class="resizer-toggle-container">
- <i [attr.title]="toggleTitle"
- class="main-menu--navigation-toggler"
- [ngClass]="{'open': toggleService.showNavigation}"
- (accessibleClick)="toggleService.toggleNavigation($event)"></i>
-
- <i class="icon-resizer-vertical-lines"
- aria-hidden="true"></i>
+ <button
+ class="op-link main-menu--navigation-toggler"
+ [attr.title]="toggleTitle"
+ [class.open]="toggleService.showNavigation"
+ (click)="toggleService.toggleNavigation($event)">
+ <op-icon icon-classes="icon-resizer-vertical-lines"></op-icon>
+ </button>
</div>
</resizer>
- `
+ `,
})
export class MainMenuResizerComponent extends UntilDestroyedMixin implements OnInit {
@@ -76,7 +76,7 @@ export class MainMenuResizerComponent extends UntilDestroyedMixin implements OnI
this.toggleService.titleData$
.pipe(
distinctUntilChanged(),
- this.untilDestroyed()
+ this.untilDestroyed(),
)
.subscribe(setToggleTitle => {
this.toggleTitle = setToggleTitle;
diff --git a/frontend/src/app/shared/components/table-pagination/table-pagination.component.html b/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
index 11fa82cfede..7b90296d710 100644
--- a/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
+++ b/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
@@ -3,22 +3,26 @@
<ul class="pagination--items">
<li [hidden]="pagination.page == 1 || !showPageSelections" class="pagination--item">
- <a (accessibleClick)="showPage(pagination.page - 1)"
- rel="prev start"
- [attr.aria-label]="text.label_previous"
- id= "pagination--prev-link"
- role="link"
- href>&#60;</a>
+ <button
+ type="button"
+ (click)="showPage(pagination.page - 1)"
+ rel="prev start"
+ [attr.aria-label]="text.label_previous"
+ id="pagination--prev-link"
+ >
+ &#60;
+ </button>
</li>
<ng-container *ngIf="prePageNumbers.length > 0">
<li *ngFor="let pageNumber of prePageNumbers"
- class="pagination--item">
- <a (accessibleClick)="showPage(pageNumber)"
- rel="next"
- role="link"
- [textContent]="pageNumber"
- href></a>
+ class="pagination--item">
+ <button
+ type="button"
+ (click)="showPage(pageNumber)"
+ rel="next"
+ [textContent]="pageNumber"
+ ></button>
</li>
<li class="pagination--space">…</li>
</ng-container>
@@ -28,12 +32,13 @@
[ngClass]="{ '-current': pageNumber == pagination.page }"
class="pagination--item pagination-number">
<em *ngIf="pageNumber == pagination.page">{{ pageNumber }}</em>
- <a *ngIf="pageNumber != pagination.page"
- (accessibleClick)="showPage(pageNumber)"
+ <button
+ type="button"
+ *ngIf="pageNumber != pagination.page"
+ (click)="showPage(pageNumber)"
rel="next"
- role="link"
[textContent]="pageNumber"
- href></a>
+ ></button>
</li>
<li *ngIf="postPageNumbers.length" class="pagination--space">…</li>
@@ -41,23 +46,27 @@
<ng-container *ngIf="postPageNumbers.length">
<li *ngFor="let pageNumber of postPageNumbers" class="pagination--item pagination-number">
- <a (accessibleClick)="showPage(pageNumber)"
- rel="next"
- role="link"
- [textContent]="pageNumber"
- href></a>
+ <button
+ type="button"
+ (click)="showPage(pageNumber)"
+ rel="next"
+ [textContent]="pageNumber"
+ ></button>
</li>
</ng-container>
<li [hidden]="!(pagination.total && pagination.page < pageNumbers[pageNumbers.length - 1])"
- class="pagination--item">
- <a (accessibleClick)="showPage(pagination.page + 1)"
- rel="next"
- class="pagination--next-link"
- [attr.aria-label]="text.label_next"
- id="pagination--next-link"
- role="link"
- href>&#62;</a>
+ class="pagination--item">
+ <button
+ type="button"
+ (click)="showPage(pagination.page + 1)"
+ rel="next"
+ class="pagination--next-link"
+ [attr.aria-label]="text.label_next"
+ id="pagination--next-link"
+ >
+ &#62;
+ </button>
</li>
<li class="pagination--range">
@@ -89,13 +98,14 @@
class="pagination--item">
<span *ngIf="perPageOption != pagination.perPage">
- <a (accessibleClick)="selectPerPage(perPageOption)"
- role="link"
- [textContent]="perPageOption"
- href></a>
+ <button
+ type="button"
+ (click)="selectPerPage(perPageOption)"
+ [textContent]="perPageOption"
+ ></button>
</span>
- <span *ngIf="perPageOption == pagination.perPage">{{ perPageOption }}</span>
+ <span *ngIf="perPageOption == pagination.perPage">{{ perPageOption }}</span>
</li>
</ul>
</div>
diff --git a/frontend/src/app/shared/directives/a11y/accessible-click.directive.spec.ts b/frontend/src/app/shared/directives/a11y/accessible-click.directive.spec.ts
deleted file mode 100644
index fdd49ac73fd..00000000000
--- a/frontend/src/app/shared/directives/a11y/accessible-click.directive.spec.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2021 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See docs/COPYRIGHT.rdoc for more details.
-//++
-
-import { Component, DebugElement } from "@angular/core";
-
-import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
-import { By } from "@angular/platform-browser";
-import { AccessibleClickDirective } from "core-app/shared/directives/a11y/accessible-click.directive";
-
-@Component({
- template: `<div (accessibleClick)="onClick()">Click me</div>`
-})
-class TestAccessibleClickDirective {
- public onClick() {
- }
-}
-
-@Component({
- template: `<div (accessibleClick)="onClick()" [accessibleClickSkipModifiers]="true">Click me</div>`
-})
-class TestAccessibleClickDirectiveSkippedModifiers {
- public onClick() {
- }
-}
-
-describe('accessibleByKeyboard component', () => {
-
- beforeEach((() => {
-
- // noinspection JSIgnoredPromiseFromCall
- TestBed.configureTestingModule({
- declarations: [
- AccessibleClickDirective,
- TestAccessibleClickDirective,
- TestAccessibleClickDirectiveSkippedModifiers
- ]
- }).compileComponents();
- }));
-
- describe('triggering the click handler', () => {
- let app:TestAccessibleClickDirective;
- let fixture:ComponentFixture<TestAccessibleClickDirective>;
- let element:DebugElement;
-
- it('should render an inner link with specified classes', fakeAsync(() => {
- fixture = TestBed.createComponent(TestAccessibleClickDirective);
- app = fixture.debugElement.componentInstance;
- element = fixture.debugElement.query(By.css('div'));
-
- const spy = spyOn(app, 'onClick');
- fixture.detectChanges();
-
- // Trigger click
- element.triggerEventHandler('click', new MouseEvent('click', { ctrlKey: true }));
- element.triggerEventHandler('click', new MouseEvent('click', { ctrlKey: false }));
- element.triggerEventHandler('keydown',new KeyboardEvent('keydown', { key: ' ' }));
-
- tick();
- fixture.detectChanges();
- expect(spy).toHaveBeenCalledTimes(3);
- }));
-
- it('allows to disable click handling with modifiers', fakeAsync(() => {
- fixture = TestBed.createComponent(TestAccessibleClickDirectiveSkippedModifiers);
- app = fixture.debugElement.componentInstance;
- element = fixture.debugElement.query(By.css('div'));
-
- const spy = spyOn(app, 'onClick');
- fixture.detectChanges();
-
- // Trigger click
- element.triggerEventHandler('click', new MouseEvent('click', { ctrlKey: true }));
- element.triggerEventHandler('click', new MouseEvent('click', { ctrlKey: false }));
- element.triggerEventHandler('keydown',new KeyboardEvent('keydown', { key: ' ' }));
-
- tick();
- fixture.detectChanges();
- expect(spy).toHaveBeenCalledTimes(2);
- }));
- });
-});
-
-
-
diff --git a/frontend/src/app/shared/directives/a11y/accessible-click.directive.ts b/frontend/src/app/shared/directives/a11y/accessible-click.directive.ts
deleted file mode 100644
index 2051cc6b881..00000000000
--- a/frontend/src/app/shared/directives/a11y/accessible-click.directive.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2021 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See docs/COPYRIGHT.rdoc for more details.
-//++
-
-import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
-import { LinkHandling } from 'core-app/shared/helpers/link-handling/link-handling';
-
-@Directive({
- selector: '[accessibleClick]',
-})
-export class AccessibleClickDirective {
- @Input('accessibleClickStopEvent') stopEventPropagation = true;
- @Input('accessibleClickSkipModifiers') skipEventModifiers = false;
- @Output('accessibleClick') onClick = new EventEmitter<MouseEvent|KeyboardEvent>();
-
- @HostListener('click', ['$event'])
- @HostListener('keydown', ['$event'])
- public handleClick(event:MouseEvent|KeyboardEvent) {
- if (this.isMatchingEvent(event) && !this.skipOnModifier(event)) {
- if (this.stopEventPropagation) {
- event.preventDefault();
- event.stopPropagation();
- }
-
- this.onClick.emit(event);
- }
- }
-
- /**
- * Whether the given event is handled by this directive
- * @param event
- * @private
- */
- private isMatchingEvent(event:MouseEvent|KeyboardEvent) {
- return event.type === 'click' ||
- (event instanceof KeyboardEvent && (event.key === 'Enter' || event.key === ' '));
- }
-
- /**
- * Whether to skip the click event with modifiers pressed
- * according to the input being set.
- *
- * @param event
- * @private
- */
- private skipOnModifier(event:MouseEvent|KeyboardEvent) {
- return this.skipEventModifiers && event instanceof MouseEvent && LinkHandling.isClickedWithModifier(event);
- }
-}
diff --git a/frontend/src/app/shared/directives/a11y/openproject-a11y.module.ts b/frontend/src/app/shared/directives/a11y/openproject-a11y.module.ts
index 06da8b3ff44..c25e58b8534 100644
--- a/frontend/src/app/shared/directives/a11y/openproject-a11y.module.ts
+++ b/frontend/src/app/shared/directives/a11y/openproject-a11y.module.ts
@@ -30,7 +30,6 @@
import { NgModule } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { CommonModule } from "@angular/common";
-import { AccessibleClickDirective } from "core-app/shared/directives/a11y/accessible-click.directive";
import { DoubleClickOrTapDirective } from "core-app/shared/directives/a11y/double-click-or-tap.directive";
@NgModule({
@@ -39,11 +38,9 @@ import { DoubleClickOrTapDirective } from "core-app/shared/directives/a11y/doubl
CommonModule,
],
exports: [
- AccessibleClickDirective,
DoubleClickOrTapDirective,
],
declarations: [
- AccessibleClickDirective,
DoubleClickOrTapDirective,
]
})
diff --git a/frontend/src/global_styles/common/link/link.sass b/frontend/src/global_styles/common/link/link.sass
index f1b8a2d6286..be8c8b9bcab 100644
--- a/frontend/src/global_styles/common/link/link.sass
+++ b/frontend/src/global_styles/common/link/link.sass
@@ -1,12 +1,8 @@
.op-link
+ @include unset-button-styles
display: inline
color: var(--content-link-color)
text-decoration: none
- padding: 0
- margin: 0
- background: 0
- border: 0
- font: inherit
cursor: pointer
&:hover,
diff --git a/frontend/src/global_styles/content/_pagination.sass b/frontend/src/global_styles/content/_pagination.sass
index d3717109c1e..d8e3792b609 100644
--- a/frontend/src/global_styles/content/_pagination.sass
+++ b/frontend/src/global_styles/content/_pagination.sass
@@ -73,7 +73,7 @@ $pagination--font-size: 0.8125rem
font-style: italic
text-align: center
- a
+ button
margin: 0
display: block
min-width: 25px
diff --git a/frontend/src/global_styles/content/work_packages/_table_content.sass b/frontend/src/global_styles/content/work_packages/_table_content.sass
index ad9cd6cdd56..a1e80999ab4 100644
--- a/frontend/src/global_styles/content/work_packages/_table_content.sass
+++ b/frontend/src/global_styles/content/work_packages/_table_content.sass
@@ -162,6 +162,7 @@ body.-browser-edge
line-height: 22px !important
.inplace-editing--container
+ @include unset-button-styles
display: inline-block
border: 1px solid transparent
border-radius: 2px
diff --git a/frontend/src/global_styles/content/work_packages/_table_inline_create.sass b/frontend/src/global_styles/content/work_packages/_table_inline_create.sass
index 22e82412694..6a26a2372cd 100644
--- a/frontend/src/global_styles/content/work_packages/_table_inline_create.sass
+++ b/frontend/src/global_styles/content/work_packages/_table_inline_create.sass
@@ -26,6 +26,9 @@
.wp-inline-create--add-link,
.wp-inline-create--reference-link
+ @include unset-button-styles
+ cursor: pointer
+ color: var(--content-link-color)
font-weight: bold
.icon::before
@@ -34,6 +37,7 @@
font-size: 11px
&:hover
+ color: var(--content-link-hover-active-color)
text-decoration: none
.wp-inline-create-row
diff --git a/frontend/src/global_styles/content/work_packages/_table_relations.sass b/frontend/src/global_styles/content/work_packages/_table_relations.sass
index 61b8d420813..4708a176565 100644
--- a/frontend/src/global_styles/content/work_packages/_table_relations.sass
+++ b/frontend/src/global_styles/content/work_packages/_table_relations.sass
@@ -41,6 +41,7 @@ body
font-size: 0.7rem
.relation-row--type
+ @include unset-button-styles
cursor: default
// Reduce padding of relations icon in relation columns
diff --git a/frontend/src/global_styles/content/work_packages/single_view/_attachments.sass b/frontend/src/global_styles/content/work_packages/single_view/_attachments.sass
index 6fc9a2c5746..ad5735663c0 100644
--- a/frontend/src/global_styles/content/work_packages/single_view/_attachments.sass
+++ b/frontend/src/global_styles/content/work_packages/single_view/_attachments.sass
@@ -48,6 +48,9 @@
border-top: 1px solid #ddd
.work-package--attachments--drop-box
+ @include unset-button-styles
+ display: block
+ width: 100%
border: 2px dashed var(--light-gray)
border-radius: 2px
text-align: center
diff --git a/frontend/src/global_styles/content/work_packages/tabs/_relations.sass b/frontend/src/global_styles/content/work_packages/tabs/_relations.sass
index 93cd082f6b9..90de2e0c895 100644
--- a/frontend/src/global_styles/content/work_packages/tabs/_relations.sass
+++ b/frontend/src/global_styles/content/work_packages/tabs/_relations.sass
@@ -99,6 +99,7 @@
// Relation description field
.wp-relation--description-read-value
+ @include unset-button-styles
width: 100%
padding: 5px
border: 1px solid transparent
diff --git a/frontend/src/global_styles/layout/_drop_down.sass b/frontend/src/global_styles/layout/_drop_down.sass
index 1744ad69c5f..583e356c02b 100644
--- a/frontend/src/global_styles/layout/_drop_down.sass
+++ b/frontend/src/global_styles/layout/_drop_down.sass
@@ -67,11 +67,16 @@
LI > A,
.menu-item
display: block
+ margin: 0
+ background: 0
+ border: 0
color: var(--context-menu-unselected-font-color)
text-decoration: none
padding: 4px 13px 4px 10px
white-space: nowrap
font-weight: normal
+ width: 100%
+ text-align: left
&:not(.inactive):hover
background-color: #F0F0F0
diff --git a/frontend/src/global_styles/layout/_main_menu.sass b/frontend/src/global_styles/layout/_main_menu.sass
index cbd7f395fb8..b164e3f0740 100644
--- a/frontend/src/global_styles/layout/_main_menu.sass
+++ b/frontend/src/global_styles/layout/_main_menu.sass
@@ -373,7 +373,7 @@ a.main-menu--parent-node
.resizer-toggle-container
margin-top: 50vh
- margin-left: -25px
+ margin-left: -12px
display: inline-block
.main-menu--navigation-toggler
cursor: pointer
diff --git a/frontend/src/global_styles/openproject/_mixins.sass b/frontend/src/global_styles/openproject/_mixins.sass
index 3e78f52f205..e8895387bee 100644
--- a/frontend/src/global_styles/openproject/_mixins.sass
+++ b/frontend/src/global_styles/openproject/_mixins.sass
@@ -214,3 +214,11 @@ $scrollbar-size: 10px
cursor: default
border-color: #c7c7c7
background: rgba(218,223,225,0.75)
+
+@mixin unset-button-styles
+ padding: 0
+ margin: 0
+ background: transparent
+ border: 0
+ font: inherit
+ text-align: inherit
diff --git a/modules/boards/spec/features/support/board_page.rb b/modules/boards/spec/features/support/board_page.rb
index 576384d4dfb..525b4a63edf 100644
--- a/modules/boards/spec/features/support/board_page.rb
+++ b/modules/boards/spec/features/support/board_page.rb
@@ -242,7 +242,7 @@ module Pages
page.find('.board-list--menu a').click
end
- page.find('.dropdown-menu a', text: action).click
+ page.find('.dropdown-menu button', text: action).click
end
def card_for(work_package)
diff --git a/modules/my_page/spec/features/my/assigned_to_me_spec.rb b/modules/my_page/spec/features/my/assigned_to_me_spec.rb
index c9a066dcc93..c9ffccd23f8 100644
--- a/modules/my_page/spec/features/my/assigned_to_me_spec.rb
+++ b/modules/my_page/spec/features/my/assigned_to_me_spec.rb
@@ -182,7 +182,7 @@ describe 'Assigned to me embedded query on my page', type: :feature, js: true do
expect(page)
.not_to have_selector('.subject', text: assigned_work_package_2.subject)
- page.find('.pagination--item a', text: '2').click
+ page.find('.pagination--item button', text: '2').click
expect(page)
.not_to have_selector('.subject', text: assigned_work_package.subject)
diff --git a/spec/features/projects/projects_portfolio_spec.rb b/spec/features/projects/projects_portfolio_spec.rb
index 8c366e82d00..d4af85e314e 100644
--- a/spec/features/projects/projects_portfolio_spec.rb
+++ b/spec/features/projects/projects_portfolio_spec.rb
@@ -102,7 +102,7 @@ describe 'Projects index page',
expect(page).to have_selector(%(input[value="cf_#{string_cf.id}"]:checked))
# Edit the project gantt query
- scroll_to_and_click(find('a', text: 'Edit query'))
+ scroll_to_and_click(find('button', text: 'Edit query'))
columns.assume_opened
columns.uncheck_all save_changes: false
diff --git a/spec/features/work_packages/details/query_groups/relation_query_group_spec.rb b/spec/features/work_packages/details/query_groups/relation_query_group_spec.rb
index d09bbea3238..4d4b0003185 100644
--- a/spec/features/work_packages/details/query_groups/relation_query_group_spec.rb
+++ b/spec/features/work_packages/details/query_groups/relation_query_group_spec.rb
@@ -88,7 +88,7 @@ describe 'Work package with relation query group', js: true, selenium: true do
relations.expect_child(related_work_package)
# Create new work package within embedded table
- embedded_table.table_container.find("a", text: I18n.t('js.relation_buttons.add_new_child')).click
+ embedded_table.table_container.find("button", text: I18n.t('js.relation_buttons.add_new_child')).click
subject_field = embedded_table.edit_field(nil, :subject)
subject_field.expect_active!
subject_field.set_value("Fresh WP\n")
@@ -199,7 +199,7 @@ describe 'Work package with relation query group', js: true, selenium: true do
end
it 'creates and removes across all tables' do
- embedded_table.table_container.find('a', text: I18n.t('js.relation_buttons.create_new')).click
+ embedded_table.table_container.find('button', text: I18n.t('js.relation_buttons.create_new')).click
subject_field = embedded_table.edit_field(nil, :subject)
subject_field.expect_active!
@@ -210,7 +210,7 @@ describe 'Work package with relation query group', js: true, selenium: true do
end
it 'add existing, remove it, add it from relations tab, remove from relations tab' do
- embedded_table.table_container.find('a', text: I18n.t('js.relation_buttons.add_existing')).click
+ embedded_table.table_container.find('button', text: I18n.t('js.relation_buttons.add_existing')).click
container = embedded_table.table_container.find('.wp-relations-create--form', wait: 10)
autocomplete = page.find(".wp-relations--autocomplete")
select_autocomplete autocomplete,
diff --git a/spec/features/work_packages/new/new_work_package_spec.rb b/spec/features/work_packages/new/new_work_package_spec.rb
index c312a70534b..7632c72bf2d 100644
--- a/spec/features/work_packages/new/new_work_package_spec.rb
+++ b/spec/features/work_packages/new/new_work_package_spec.rb
@@ -471,7 +471,7 @@ describe 'new work package', js: true do
it 'from the relations tab' do
wp_page.visit_tab!('relations')
- click_link('Create new child')
+ click_button('Create new child')
subject = EditField.new wp_page, :subject
subject.set_value 'Child'
diff --git a/spec/features/work_packages/pagination_spec.rb b/spec/features/work_packages/pagination_spec.rb
index 140b5b5701d..150cd6eb9ed 100644
--- a/spec/features/work_packages/pagination_spec.rb
+++ b/spec/features/work_packages/pagination_spec.rb
@@ -56,7 +56,7 @@ RSpec.feature 'Work package pagination', js: true do
end
within('.pagination--pages') do
- find('.pagination--item a', text: '2').click
+ find('.pagination--item button', text: '2').click
end
within('.work-packages-partitioned-query-space--container') do
@@ -65,7 +65,7 @@ RSpec.feature 'Work package pagination', js: true do
end
within('.pagination--options') do
- find('.pagination--item a', text: '50').click
+ find('.pagination--item button', text: '50').click
end
within('.work-packages-partitioned-query-space--container') do
diff --git a/spec/features/work_packages/table/queries/filter_pagination_spec.rb b/spec/features/work_packages/table/queries/filter_pagination_spec.rb
index 6c0c1358a39..f17777f08d1 100644
--- a/spec/features/work_packages/table/queries/filter_pagination_spec.rb
+++ b/spec/features/work_packages/table/queries/filter_pagination_spec.rb
@@ -63,7 +63,7 @@ describe 'Filter updates pagination', type: :feature, js: true do
# Go to second page
within('.pagination--pages') do
- find('.pagination--item a', text: '2').click
+ find('.pagination--item button', text: '2').click
end
wp_table.expect_work_package_listed work_package_2
diff --git a/spec/features/work_packages/timeline/timeline_navigation_spec.rb b/spec/features/work_packages/timeline/timeline_navigation_spec.rb
index b14c61fb3b8..7c99798447c 100644
--- a/spec/features/work_packages/timeline/timeline_navigation_spec.rb
+++ b/spec/features/work_packages/timeline/timeline_navigation_spec.rb
@@ -349,7 +349,7 @@ RSpec.feature 'Work package timeline navigation', js: true, selenium: true do
expect(page).to have_no_selector('.-group-row .timeline-element')
click_button('wp-fold-toggle-button')
- click_link(I18n.t('js.button_collapse_all'))
+ click_button(I18n.t('js.button_collapse_all'))
# Will again fold all rows so the milestone elements should again be present
expect(page).to have_selector('.-group-row .timeline-element.milestone')
diff --git a/spec/support/components/admin/type_configuration_form.rb b/spec/support/components/admin/type_configuration_form.rb
index 699b637eb6f..e08716a8390 100644
--- a/spec/support/components/admin/type_configuration_form.rb
+++ b/spec/support/components/admin/type_configuration_form.rb
@@ -39,11 +39,11 @@ module Components
end
def add_attribute_group_button
- page.find 'a', text: I18n.t('js.admin.type_form.add_group')
+ page.find 'button', text: I18n.t('js.admin.type_form.add_group')
end
def add_table_button
- page.find 'a', text: I18n.t('js.admin.type_form.add_table')
+ page.find 'button', text: I18n.t('js.admin.type_form.add_table')
end
def reset_button
diff --git a/spec/support/components/grids/grid_area.rb b/spec/support/components/grids/grid_area.rb
index e40b8a349a0..3d6ed6dc00b 100644
--- a/spec/support/components/grids/grid_area.rb
+++ b/spec/support/components/grids/grid_area.rb
@@ -28,7 +28,7 @@ module Components
open_menu
SeleniumHubWaiter.wait
- find('a.menu-item', text: text).click
+ click_button text
end
def remove
diff --git a/spec/support/components/work_packages/context_menu.rb b/spec/support/components/work_packages/context_menu.rb
index 9867aea57fc..7585b7907a5 100644
--- a/spec/support/components/work_packages/context_menu.rb
+++ b/spec/support/components/work_packages/context_menu.rb
@@ -55,20 +55,20 @@ module Components
end
def choose(target)
- find("#{selector} a", text: target).click
+ find("#{selector} .menu-item", text: target).click
end
def expect_no_options(*options)
expect_open
options.each do |text|
- expect(page).to have_no_selector("#{selector} a", text: text)
+ expect(page).to have_no_selector("#{selector} .menu-item", text: text)
end
end
def expect_options(options)
expect_open
options.each do |text|
- expect(page).to have_selector("#{selector} a", text: text)
+ expect(page).to have_selector("#{selector} .menu-item", text: text)
end
end
diff --git a/spec/support/components/work_packages/display_representation.rb b/spec/support/components/work_packages/display_representation.rb
index f4e7e391ffb..5c5b9e7f23a 100644
--- a/spec/support/components/work_packages/display_representation.rb
+++ b/spec/support/components/work_packages/display_representation.rb
@@ -64,7 +64,7 @@ module Components
page.find('wp-view-toggle-button').click
within_view_context_menu do
- click_link(view_name)
+ click_button(view_name)
end
end
diff --git a/spec/support/components/work_packages/group_by.rb b/spec/support/components/work_packages/group_by.rb
index b4506044ed3..9f5ef535d08 100644
--- a/spec/support/components/work_packages/group_by.rb
+++ b/spec/support/components/work_packages/group_by.rb
@@ -36,7 +36,7 @@ module Components
open_table_column_context_menu(name)
within_column_context_menu do
- click_link('Group by')
+ click_button('Group by')
end
end
diff --git a/spec/support/components/work_packages/sort_by.rb b/spec/support/components/work_packages/sort_by.rb
index 7060a85f572..5dc6798c49d 100644
--- a/spec/support/components/work_packages/sort_by.rb
+++ b/spec/support/components/work_packages/sort_by.rb
@@ -40,7 +40,7 @@ module Components
SeleniumHubWaiter.wait
within_column_context_menu do
- click_link text
+ click_button text
end
end
diff --git a/spec/support/edit_fields/work_package_status_field.rb b/spec/support/edit_fields/work_package_status_field.rb
index 43136210de9..d0da13c942b 100644
--- a/spec/support/edit_fields/work_package_status_field.rb
+++ b/spec/support/edit_fields/work_package_status_field.rb
@@ -37,7 +37,7 @@ class WorkPackageStatusField < EditField
end
def set_value(content)
- input_element.find('a', text: content).click
+ input_element.find('button', text: content).click
end
def active?