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

Fixed more linting errors (#9452)

Benjamin Bädorf87cd17827045
diff --git a/app/cells/views/projects/table/show.erb b/app/cells/views/projects/table/show.erb
index 479e94c626a..731fa074fa8 100644
--- a/app/cells/views/projects/table/show.erb
+++ b/app/cells/views/projects/table/show.erb
@@ -33,7 +33,7 @@ See docs/COPYRIGHT.rdoc for more details.
<table class="generic-table" <%= table_id ? "id=\"#{table_id}\"" : '' %>>
<colgroup>
<% headers.each do |_name, _options| %>
- <col highlight-col>
+ <col opHighlightCol>
<% end %>
<col>
</colgroup>
diff --git a/app/cells/views/table/show.erb b/app/cells/views/table/show.erb
index f2402d921dd..2a0922686ed 100644
--- a/app/cells/views/table/show.erb
+++ b/app/cells/views/table/show.erb
@@ -32,7 +32,7 @@ See docs/COPYRIGHT.rdoc for more details.
<table class="generic-table">
<colgroup>
<% headers.each do |_name, _options| %>
- <col highlight-col>
+ <col opHighlightCol>
<% end %>
<col>
</colgroup>
diff --git a/app/views/attribute_help_texts/_tab.html.erb b/app/views/attribute_help_texts/_tab.html.erb
index 8b7578e84df..648e80cd207 100644
--- a/app/views/attribute_help_texts/_tab.html.erb
+++ b/app/views/attribute_help_texts/_tab.html.erb
@@ -4,9 +4,9 @@
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/auth_sources/index.html.erb b/app/views/auth_sources/index.html.erb
index 787c7165274..027f1441a03 100644
--- a/app/views/auth_sources/index.html.erb
+++ b/app/views/auth_sources/index.html.erb
@@ -45,10 +45,10 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/custom_fields/_custom_options.html.erb b/app/views/custom_fields/_custom_options.html.erb
index 044c8fdf8fe..5a6bed16c17 100644
--- a/app/views/custom_fields/_custom_options.html.erb
+++ b/app/views/custom_fields/_custom_options.html.erb
@@ -34,9 +34,9 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table" id="custom-options-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb
index c956fbbac43..a2cc90b2929 100644
--- a/app/views/custom_fields/_tab.html.erb
+++ b/app/views/custom_fields/_tab.html.erb
@@ -39,14 +39,14 @@ See docs/COPYRIGHT.rdoc for more details.
<% end %>
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<% if tab[:name] == 'WorkPackageCustomField' %>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<% end %>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb
index 97def3d9c7f..09e8e44fdab 100644
--- a/app/views/forums/index.html.erb
+++ b/app/views/forums/index.html.erb
@@ -48,12 +48,12 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table boards">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<% if User.current.allowed_to?(:manage_forums, @project) %>
- <col highlight-col>
+ <col opHighlightCol>
<col>
<% end %>
</colgroup>
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 9aec0003da8..e0805d9360f 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -71,11 +71,11 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/app/views/groups/_memberships.html.erb b/app/views/groups/_memberships.html.erb
index 0e7b8f97d6d..2d8c5833334 100644
--- a/app/views/groups/_memberships.html.erb
+++ b/app/views/groups/_memberships.html.erb
@@ -36,8 +36,8 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table memberships">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/groups/_users_table.html.erb b/app/views/groups/_users_table.html.erb
index 945cf04a277..f78a6ac2518 100644
--- a/app/views/groups/_users_table.html.erb
+++ b/app/views/groups/_users_table.html.erb
@@ -29,7 +29,7 @@ See docs/COPYRIGHT.rdoc for more details.
<table class="generic-table users">
<colgroup>
- <col highlight-col>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb
index 6103c9e81d0..a26fac7aaa3 100644
--- a/app/views/groups/index.html.erb
+++ b/app/views/groups/index.html.erb
@@ -44,8 +44,8 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/individual_principals/_memberships.html.erb b/app/views/individual_principals/_memberships.html.erb
index b16a08d4417..931dd5d7c2c 100644
--- a/app/views/individual_principals/_memberships.html.erb
+++ b/app/views/individual_principals/_memberships.html.erb
@@ -40,8 +40,8 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table memberships">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<%= call_individual_principals_memberships_hook(@individual_principal, 'colgroup') %>
<col>
</colgroup>
diff --git a/app/views/my/access_token.html.erb b/app/views/my/access_token.html.erb
index 38ad168ee25..3854373e3f6 100644
--- a/app/views/my/access_token.html.erb
+++ b/app/views/my/access_token.html.erb
@@ -39,10 +39,10 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container" style="max-height: 340px;">
<table id="access-token-table" class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/app/views/project_settings/categories.html.erb b/app/views/project_settings/categories.html.erb
index a97e302b536..50cee4648f4 100644
--- a/app/views/project_settings/categories.html.erb
+++ b/app/views/project_settings/categories.html.erb
@@ -46,8 +46,8 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/projects/form/_custom_fields.html.erb b/app/views/projects/form/_custom_fields.html.erb
index 91490afaa7c..8e0eb64f26c 100644
--- a/app/views/projects/form/_custom_fields.html.erb
+++ b/app/views/projects/form/_custom_fields.html.erb
@@ -31,9 +31,9 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/app/views/projects/form/_types.html.erb b/app/views/projects/form/_types.html.erb
index eaf1cf0c0a9..2e35a222acd 100644
--- a/app/views/projects/form/_types.html.erb
+++ b/app/views/projects/form/_types.html.erb
@@ -31,11 +31,11 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table types">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/app/views/repositories/_dir_list.html.erb b/app/views/repositories/_dir_list.html.erb
index 6e17ad2b325..ecec19d58be 100644
--- a/app/views/repositories/_dir_list.html.erb
+++ b/app/views/repositories/_dir_list.html.erb
@@ -30,13 +30,13 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table" id="browser">
<colgroup>
- <col highlight-col>
+ <col opHighlightCol>
<col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr id="root">
diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb
index 3e564ec91f8..fc1cfc3bbc1 100644
--- a/app/views/repositories/_revisions.html.erb
+++ b/app/views/repositories/_revisions.html.erb
@@ -32,12 +32,12 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table changesets">
<colgroup>
- <col highlight-col>
+ <col opHighlightCol>
<col>
<col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<caption class="hidden-for-sighted">
<span>
diff --git a/app/views/repositories/committers.html.erb b/app/views/repositories/committers.html.erb
index 7183d6e34ea..cdeaf5787de 100644
--- a/app/views/repositories/committers.html.erb
+++ b/app/views/repositories/committers.html.erb
@@ -36,8 +36,8 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb
index 7f168986395..b28cf0b66e5 100644
--- a/app/views/roles/index.html.erb
+++ b/app/views/roles/index.html.erb
@@ -43,9 +43,9 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/roles/report.html.erb b/app/views/roles/report.html.erb
index 4df4f390d5e..679f1ff8d4f 100644
--- a/app/views/roles/report.html.erb
+++ b/app/views/roles/report.html.erb
@@ -54,12 +54,12 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb
index 4181de03648..0df91b4b4d7 100644
--- a/app/views/types/index.html.erb
+++ b/app/views/types/index.html.erb
@@ -47,13 +47,13 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
+ <col opHighlightCol>
<col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/users/_global_roles.html.erb b/app/views/users/_global_roles.html.erb
index 9b4798c34f7..23ec3fe53f5 100644
--- a/app/views/users/_global_roles.html.erb
+++ b/app/views/users/_global_roles.html.erb
@@ -40,7 +40,7 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table principal_roles" id="table_principal_roles">
<colgroup>
- <col highlight-col>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erb
index 488fc4f2560..d22f4a385ed 100644
--- a/app/views/wiki/history.html.erb
+++ b/app/views/wiki/history.html.erb
@@ -35,12 +35,12 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table wiki-page-versions">
<colgroup>
- <col highlight-col>
+ <col opHighlightCol>
<col>
<col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<caption class="hidden-for-sighted">
diff --git a/app/views/work_packages/reports/_report.html.erb b/app/views/work_packages/reports/_report.html.erb
index d4ba95d3fc9..803c3a42054 100644
--- a/app/views/work_packages/reports/_report.html.erb
+++ b/app/views/work_packages/reports/_report.html.erb
@@ -39,7 +39,7 @@ See docs/COPYRIGHT.rdoc for more details.
<table class="generic-table">
<colgroup>
<% column_names.each do |name| %>
- <col highlight-col>
+ <col opHighlightCol>
<% end %>
</colgroup>
<thead>
diff --git a/app/views/workflows/show.html.erb b/app/views/workflows/show.html.erb
index 741e8737acb..b9f987e3a99 100644
--- a/app/views/workflows/show.html.erb
+++ b/app/views/workflows/show.html.erb
@@ -37,11 +37,11 @@ See docs/COPYRIGHT.rdoc for more details.
<table class="generic-table">
<colgroup>
<col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js
index 8ca9766c057..5f0b9c0aa30 100644
--- a/frontend/.eslintrc.js
+++ b/frontend/.eslintrc.js
@@ -67,6 +67,13 @@ module.exports = {
// Disable webpack loader definitions
"import/no-webpack-loader-syntax": "off",
+ // It'd be good if we could error this for switch cases but allow it for for loops
+ "no-continue": "off",
+
+ // No void at all collides with `@typescript-eslint/no-floating-promises` which wants us to handle each promise.
+ // Until we do that, `void` is a good way to explicitly mark unhandled promises.
+ "no-void": ["error", { allowAsStatement: true }],
+
/*
// Disable use before define, as irrelevant for TS interfaces
"no-use-before-define": "off",
@@ -104,15 +111,6 @@ module.exports = {
// It's common in Angular to wrap even pure functions in classes for injection purposes
// TODO: Should probably be turned off and pure unit tests should be used at some point
"class-methods-use-this": "warn",
-
- // There's too much interop with legacy code that is `any`-typed for this to be an error in any practical sense
- // TODO: Actually type everything
- "@typescript-eslint/no-unsafe-member-access": "warn",
- "@typescript-eslint/no-unsafe-assignment": "warn",
- "@typescript-eslint/no-unsafe-call": "warn",
-
- // This is probably the first rule that should be fixed. It had 309 errors last time we checked
- "@typescript-eslint/no-unsafe-return": "warn",
}
},
{
diff --git a/frontend/package.json b/frontend/package.json
index de0bc0cdf79..4916469425f 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -138,7 +138,7 @@
"pretest": "./scripts/link_plugin_placeholder.js",
"test": "ng test --watch=false",
"test:watch": "ng test --watch=true",
- "lint": "eslint -c .eslintrc.js --ext .ts src/app/",
+ "lint": "esprint check",
"lint:fix": "esprint check --fix",
"generate-typings": "tsc -d -p src/tsconfig.app.json"
}
diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts
index 1239bf2156b..002260ed63c 100644
--- a/frontend/src/app/app.module.ts
+++ b/frontend/src/app/app.module.ts
@@ -51,7 +51,7 @@ import { PreviewTriggerService } from 'core-app/core/setup/globals/global-listen
import { OpenprojectOverviewModule } from 'core-app/features/overview/openproject-overview.module';
import { OpenprojectMyPageModule } from 'core-app/features/my-page/openproject-my-page.module';
import { OpenprojectProjectsModule } from 'core-app/features/projects/openproject-projects.module';
-import { KeyboardShortcutService } from 'core-app/shared/directives/a11y/keyboard-shortcut-service';
+import { KeyboardShortcutService } from 'core-app/shared/directives/a11y/keyboard-shortcut.service';
import { OpenprojectMembersModule } from 'core-app/shared/components/autocompleter/members-autocompleter/members.module';
import { OpenprojectAugmentingModule } from 'core-app/core/augmenting/openproject-augmenting.module';
import { OpenprojectInviteUserModalModule } from 'core-app/features/invite-user-modal/invite-user-modal.module';
diff --git a/frontend/src/app/core/global_search/input/global-search-input.component.ts b/frontend/src/app/core/global_search/input/global-search-input.component.ts
index c1bb2033455..eff209b7689 100644
--- a/frontend/src/app/core/global_search/input/global-search-input.component.ts
+++ b/frontend/src/app/core/global_search/input/global-search-input.component.ts
@@ -44,7 +44,7 @@ import { GlobalSearchService } from 'core-app/core/global_search/services/global
import { isClickedWithModifier } from 'core-app/shared/helpers/link-handling/link-handling';
import { Highlighting } from 'core-app/features/work-packages/components/wp-fast-table/builders/highlighting/highlighting.functions';
import { DeviceService } from 'core-app/core/browser/device.service';
-import { ContainHelpers } from 'core-app/shared/directives/focus/contain-helpers';
+import { insideOrSelf } from 'core-app/shared/directives/focus/contain-helpers';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
@@ -156,7 +156,7 @@ export class GlobalSearchInputComponent implements AfterViewInit, OnDestroy {
event.preventDefault();
// handle click on search button
- if (ContainHelpers.insideOrSelf(this.btn.nativeElement, event.target)) {
+ if (insideOrSelf(this.btn.nativeElement, event.target)) {
if (this.deviceService.isMobile) {
this.toggleMobileSearch();
// open ng-select menu on default
diff --git a/frontend/src/app/features/admin/openproject-admin.module.ts b/frontend/src/app/features/admin/openproject-admin.module.ts
index 0472d27082c..6d79d366a29 100644
--- a/frontend/src/app/features/admin/openproject-admin.module.ts
+++ b/frontend/src/app/features/admin/openproject-admin.module.ts
@@ -33,14 +33,12 @@ import { TypeFormAttributeGroupComponent } from 'core-app/features/admin/types/a
import { TypeFormConfigurationComponent } from 'core-app/features/admin/types/type-form-configuration.component';
import { TypeFormQueryGroupComponent } from 'core-app/features/admin/types/query-group.component';
import { GroupEditInPlaceComponent } from 'core-app/features/admin/types/group-edit-in-place.component';
-import { OpenprojectAccessibilityModule } from 'core-app/shared/directives/a11y/openproject-a11y.module';
import { EditableQueryPropsComponent } from 'core-app/features/admin/editable-query-props/editable-query-props.component';
@NgModule({
imports: [
DragulaModule.forRoot(),
OPSharedModule,
- OpenprojectAccessibilityModule,
],
providers: [
],
diff --git a/frontend/src/app/features/admin/types/group-edit-in-place.html b/frontend/src/app/features/admin/types/group-edit-in-place.html
index ab9a39d53d4..991dcf01dd0 100644
--- a/frontend/src/app/features/admin/types/group-edit-in-place.html
+++ b/frontend/src/app/features/admin/types/group-edit-in-place.html
@@ -8,7 +8,7 @@
*ngIf="editing"
class="group-edit-in-place--input"
type="text"
- autoFocus
+ opAutofocus
[(ngModel)]="editedName"
[attr.placeholder]="placeholder"
(blur)="saveEdition($event)"
diff --git a/frontend/src/app/features/boards/add-list-modal/add-list-modal.component.ts b/frontend/src/app/features/boards/add-list-modal/add-list-modal.component.ts
index c726a08f96a..17d0bd93d9d 100644
--- a/frontend/src/app/features/boards/add-list-modal/add-list-modal.component.ts
+++ b/frontend/src/app/features/boards/add-list-modal/add-list-modal.component.ts
@@ -41,7 +41,7 @@ import { BoardService } from 'core-app/features/boards/board/board.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { BoardActionsRegistryService } from 'core-app/features/boards/board/board-actions/board-actions-registry.service';
import { BoardActionService } from 'core-app/features/boards/board/board-actions/board-action.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByHref } from 'core-app/shared/helpers/angular/tracking-functions';
import { CreateAutocompleterComponent } from 'core-app/shared/components/autocompleter/create-autocompleter/create-autocompleter.component';
import { ValueOption } from 'core-app/shared/components/fields/edit/field-types/select-edit-field/select-edit-field.component';
import { OpModalLocalsToken } from 'core-app/shared/components/modal/modal.service';
@@ -78,7 +78,7 @@ export class AddListModalComponent extends OpModalComponent implements OnInit {
/** avoid double click */
public inFlight = false;
- public trackByHref = AngularTrackingHelpers.trackByHref;
+ public trackByHref = trackByHref;
/* Do not close on outside click (because the select option are appended to the body */
public closeOnOutsideClick = false;
diff --git a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts
index 4112830fcf1..5fae3db86ca 100644
--- a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts
+++ b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts
@@ -38,7 +38,7 @@ import { StateService } from '@uirouter/core';
import { BoardService } from 'core-app/features/boards/board/board.service';
import { BoardActionsRegistryService } from 'core-app/features/boards/board/board-actions/board-actions-registry.service';
import { BoardActionService } from 'core-app/features/boards/board/board-actions/board-action.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByHref } from 'core-app/shared/helpers/angular/tracking-functions';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { tap } from 'rxjs/operators';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -84,7 +84,7 @@ export class AddListModalComponent extends OpModalComponent implements OnInit {
/** avoid double click */
public inFlight = false;
- public trackByHref = AngularTrackingHelpers.trackByHref;
+ public trackByHref = trackByHref;
/* Do not close on outside click (because the select option are appended to the body */
public closeOnOutsideClick = false;
diff --git a/frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts b/frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts
index 9e2ca3195b5..67658d5bcf2 100644
--- a/frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts
+++ b/frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { BoardService } from 'core-app/features/boards/board/board.service';
import { Board } from 'core-app/features/boards/board/board';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { compareByAttribute } from 'core-app/shared/helpers/angular/tracking-functions';
import { map } from 'rxjs/operators';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
@@ -17,7 +17,7 @@ export const boardsMenuSelector = 'boards-menu';
})
export class BoardsMenuComponent extends UntilDestroyedMixin implements OnInit {
- trackById = AngularTrackingHelpers.compareByAttribute('id');
+ trackById = compareByAttribute('id');
currentProjectIdentifier = this.currentProject.identifier;
diff --git a/frontend/src/app/features/boards/index-page/boards-index-page.component.html b/frontend/src/app/features/boards/index-page/boards-index-page.component.html
index 50fb125dc9a..7c18c26462c 100644
--- a/frontend/src/app/features/boards/index-page/boards-index-page.component.html
+++ b/frontend/src/app/features/boards/index-page/boards-index-page.component.html
@@ -27,10 +27,10 @@
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts
index 6367c40899c..0249dc2a64a 100644
--- a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts
+++ b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts
@@ -31,7 +31,7 @@ import { FormBuilder, Validators } from '@angular/forms';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { EnterpriseTrialData, EnterpriseTrialService } from 'core-app/features/enterprise/enterprise-trial.service';
import { CurrentUserService } from 'core-app/core/current-user/current-user.service';
-import { I18nHelpers } from 'core-app/shared/helpers/i18n/localized-link';
+import { localizeLink } from 'core-app/shared/helpers/i18n/localized-link';
const newsletterURL = 'https://www.openproject.com/newsletter/';
@@ -57,11 +57,11 @@ export class EETrialFormComponent {
public text = {
general_consent: this.I18n.t('js.admin.enterprise.trial.form.general_consent', {
- link_terms: I18nHelpers.localizeLink({
+ link_terms: localizeLink({
en: 'https://www.openproject.com/terms-of-service/',
de: 'https://www.openproject.org/de/nutzungsbedingungen/',
}),
- link_privacy: I18nHelpers.localizeLink({
+ link_privacy: localizeLink({
en: 'https://www.openproject.org/data-privacy-and-security/',
de: 'https://www.openproject.org/de/datenschutz/',
}),
diff --git a/frontend/src/app/features/hal/resources/hal-resource.ts b/frontend/src/app/features/hal/resources/hal-resource.ts
index 2f46bae3085..4c28d8a83fd 100644
--- a/frontend/src/app/features/hal/resources/hal-resource.ts
+++ b/frontend/src/app/features/hal/resources/hal-resource.ts
@@ -30,9 +30,9 @@ import { InputState } from 'reactivestates';
import { Injector } from '@angular/core';
import { States } from 'core-app/core/states/states.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { InjectField } from "core-app/shared/helpers/angular/inject-field.decorator";
-import { HalLinkInterface } from "core-app/features/hal/hal-link/hal-link";
-import { ICKEditorContext } from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
+import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
+import { HalLinkInterface } from 'core-app/features/hal/hal-link/hal-link';
+import { ICKEditorContext } from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
export interface HalResourceClass<T extends HalResource = HalResource> {
new(injector:Injector,
diff --git a/frontend/src/app/features/hal/resources/project-resource.ts b/frontend/src/app/features/hal/resources/project-resource.ts
index 6f4cd47dca4..893cd25ed6f 100644
--- a/frontend/src/app/features/hal/resources/project-resource.ts
+++ b/frontend/src/app/features/hal/resources/project-resource.ts
@@ -27,7 +27,7 @@
//++
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
-import { ICKEditorContext } from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
+import { ICKEditorContext } from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
export class ProjectResource extends HalResource {
public get state() {
diff --git a/frontend/src/app/features/hal/resources/work-package-resource.ts b/frontend/src/app/features/hal/resources/work-package-resource.ts
index e68ed6b999c..a43f60b5fcf 100644
--- a/frontend/src/app/features/hal/resources/work-package-resource.ts
+++ b/frontend/src/app/features/hal/resources/work-package-resource.ts
@@ -43,7 +43,7 @@ import { TypeResource } from 'core-app/features/hal/resources/type-resource';
import { RelationResource } from 'core-app/features/hal/resources/relation-resource';
import { FormResource } from 'core-app/features/hal/resources/form-resource';
import { Attachable } from 'core-app/features/hal/resources/mixins/attachable-mixin';
-import { ICKEditorContext } from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
+import { ICKEditorContext } from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
export interface WorkPackageResourceEmbedded {
activities:CollectionResource;
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-container/filter-container.directive.html b/frontend/src/app/features/work-packages/components/filters/filter-container/filter-container.directive.html
index 45929e98a4d..6544fa1834c 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-container/filter-container.directive.html
+++ b/frontend/src/app/features/work-packages/components/filters/filter-container/filter-container.directive.html
@@ -1,17 +1,26 @@
-<button class="button -small advanced-filters--toggle"
- (click)="wpFiltersService.toggleVisibility()"
- [class.-active]="visible$ | async"
- *ngIf="showFilterButton">
+<button
+ class="button -small advanced-filters--toggle"
+ (click)="wpFiltersService.toggleVisibility()"
+ [class.-active]="visible$ | async"
+ *ngIf="showFilterButton"
+>
<i class="button--icon icon-filter"></i>
<span class="button--text" [textContent]="filterButtonText"></span>
</button>
-<div class="work-packages--filters-optional-container"
- [ngClass]="{ '-loaded': loaded }">
- <div id="query_form_content" class="hide-when-print" *ngIf="visible$ | async">
- <query-filters *ngIf="!!filters"
- [filters]="filters"
- [showCloseFilter]="true"
- (filtersChanged)="replaceIfComplete($event)"></query-filters>
+<div
+ class="work-packages--filters-optional-container"
+ [ngClass]="{ '-loaded': loaded }"
+>
+ <div
+ id="query_form_content"
+ class="hide-when-print" *ngIf="visible$ | async"
+ >
+ <query-filters
+ *ngIf="!!filters"
+ [filters]="filters"
+ [showCloseFilter]="true"
+ (filtersChanged)="replaceIfComplete($event)"
+ ></query-filters>
</div>
</div>
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-date-time-value/filter-date-time-value.component.html b/frontend/src/app/features/work-packages/components/filters/filter-date-time-value/filter-date-time-value.component.html
index f64a9a755f9..f49c9e84d4a 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-date-time-value/filter-date-time-value.component.html
+++ b/frontend/src/app/features/work-packages/components/filters/filter-date-time-value/filter-date-time-value.component.html
@@ -1,7 +1,7 @@
<div class="inline-label" id="div-values-{{filter.id}}">
<op-date-picker (onChange)="value = isoDateParser($event)"
[initialDate]="isoDateFormatter(value)"
- [focus]="shouldFocus"
+ [opAutofocus]="shouldFocus"
required="true"
[id]="'values-' + filter.id"
[name]="'v[' + filter.id + ']'"
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.html b/frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.html
index d3ec7f73867..c5aaf1852dd 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.html
+++ b/frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.html
@@ -1,7 +1,7 @@
<div id="div-values-{{filter.id}}" class="inline-label">
<op-date-picker (onChange)="begin = isoDateParser($event)"
[initialDate]="isoDateFormatter(begin)"
- [focus]="shouldFocus"
+ [opAutofocus]="shouldFocus"
required="true"
[id]="'values-' + filter.id + '-begin'"
[name]="'v[' + filter.id + ']-begin'"
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-date-value/filter-date-value.component.html b/frontend/src/app/features/work-packages/components/filters/filter-date-value/filter-date-value.component.html
index 25641e0ad73..0fe8b603961 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-date-value/filter-date-value.component.html
+++ b/frontend/src/app/features/work-packages/components/filters/filter-date-value/filter-date-value.component.html
@@ -1,7 +1,7 @@
<div id="div-values-{{filter.id}}">
<op-date-picker (onChange)="value = parser($event)"
[initialDate]="formatter(value)"
- [focus]="shouldFocus"
+ [opAutofocus]="shouldFocus"
required="true"
[id]="'values-' + filter.id"
[name]="'v[' + filter.id + ']'"
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-dates-value/filter-dates-value.component.html b/frontend/src/app/features/work-packages/components/filters/filter-dates-value/filter-dates-value.component.html
index 73fb59f1be1..d7e2e17c39b 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-dates-value/filter-dates-value.component.html
+++ b/frontend/src/app/features/work-packages/components/filters/filter-dates-value/filter-dates-value.component.html
@@ -2,7 +2,7 @@
class="inline-label">
<op-date-picker (onChange)="begin = parser($event)"
[initialDate]="formatter(begin)"
- [focus]="shouldFocus"
+ [opAutofocus]="shouldFocus"
required="true"
[id]="'values-' + filter.id + '-begin'"
[name]="'v[' + filter.id + ']-begin'"
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-integer-value/filter-integer-value.component.html b/frontend/src/app/features/work-packages/components/filters/filter-integer-value/filter-integer-value.component.html
index 83df05e0ec8..5a75d482449 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-integer-value/filter-integer-value.component.html
+++ b/frontend/src/app/features/work-packages/components/filters/filter-integer-value/filter-integer-value.component.html
@@ -1,6 +1,6 @@
<div id="div-values-{{filter.id}}" class="inline-label">
<input [(ngModel)]="value"
- [focus]="shouldFocus"
+ [opAutofocus]="shouldFocus"
required
class="advanced-filters--number-field"
id="values-{{filter.id}}"
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-searchable-multiselect-value/filter-searchable-multiselect-value.component.ts b/frontend/src/app/features/work-packages/components/filters/filter-searchable-multiselect-value/filter-searchable-multiselect-value.component.ts
index 679ae1224f8..ee180f10931 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-searchable-multiselect-value/filter-searchable-multiselect-value.component.ts
+++ b/frontend/src/app/features/work-packages/components/filters/filter-searchable-multiselect-value/filter-searchable-multiselect-value.component.ts
@@ -17,7 +17,7 @@ import {
ChangeDetectorRef,
Component, EventEmitter, Input, NgZone, OnInit, Output, ViewChild,
} from '@angular/core';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { compareByHrefOrString } from 'core-app/shared/helpers/angular/tracking-functions';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { I18nService } from 'core-app/core/i18n/i18n.service';
@@ -37,7 +37,7 @@ export class FilterSearchableMultiselectValueComponent extends UntilDestroyedMix
public _availableOptions:HalResource[] = [];
- public compareByHrefOrString = AngularTrackingHelpers.compareByHrefOrString;
+ public compareByHrefOrString = compareByHrefOrString;
public active:Set<string>;
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-string-value/filter-string-value.component.html b/frontend/src/app/features/work-packages/components/filters/filter-string-value/filter-string-value.component.html
index d5128be1c79..79176a3a862 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-string-value/filter-string-value.component.html
+++ b/frontend/src/app/features/work-packages/components/filters/filter-string-value/filter-string-value.component.html
@@ -1,6 +1,6 @@
<div id="div-values-{{filter.name}}">
<input [(ngModel)]="value"
- [focus]="shouldFocus"
+ [opAutofocus]="shouldFocus"
requried="true"
class="advanced-filters--text-field"
id="values-{{filter.name}}"
diff --git a/frontend/src/app/features/work-packages/components/filters/filter-toggled-multiselect-value/filter-toggled-multiselect-value.component.ts b/frontend/src/app/features/work-packages/components/filters/filter-toggled-multiselect-value/filter-toggled-multiselect-value.component.ts
index 076aaeb7e4e..eae9c7ea8e3 100644
--- a/frontend/src/app/features/work-packages/components/filters/filter-toggled-multiselect-value/filter-toggled-multiselect-value.component.ts
+++ b/frontend/src/app/features/work-packages/components/filters/filter-toggled-multiselect-value/filter-toggled-multiselect-value.component.ts
@@ -40,7 +40,7 @@ import {
ViewChild,
} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { compareByHrefOrString } from 'core-app/shared/helpers/angular/tracking-functions';
import { HalResourceSortingService } from 'core-app/features/hal/services/hal-resource-sorting.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { NgSelectComponent } from '@ng-select/ng-select';
@@ -67,7 +67,7 @@ export class FilterToggledMultiselectValueComponent implements OnInit, AfterView
public _availableOptions:HalResource[] = [];
- public compareByHrefOrString = AngularTrackingHelpers.compareByHrefOrString;
+ public compareByHrefOrString = compareByHrefOrString;
private _isEmpty:boolean;
diff --git a/frontend/src/app/features/work-packages/components/filters/query-filter/query-filter.component.ts b/frontend/src/app/features/work-packages/components/filters/query-filter/query-filter.component.ts
index 9b796ce8100..ca88d359eb5 100644
--- a/frontend/src/app/features/work-packages/components/filters/query-filter/query-filter.component.ts
+++ b/frontend/src/app/features/work-packages/components/filters/query-filter/query-filter.component.ts
@@ -30,7 +30,7 @@ import {
Component, EventEmitter, Input, OnInit, Output,
} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { halHref, compareByHref } from 'core-app/shared/helpers/angular/tracking-functions';
import { BannersService } from 'core-app/core/enterprise/banners.service';
import { WorkPackageViewFiltersService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
import { SchemaCacheService } from 'core-app/core/schemas/schema-cache.service';
@@ -57,9 +57,9 @@ export class QueryFilterComponent implements OnInit {
public eeShowBanners = false;
- public trackByHref = AngularTrackingHelpers.halHref;
+ public trackByHref = halHref;
- public compareByHref = AngularTrackingHelpers.compareByHref;
+ public compareByHref = compareByHref;
public text = {
open_filter: this.I18n.t('js.filter.description.text_open_filter'),
diff --git a/frontend/src/app/features/work-packages/components/filters/query-filters/query-filters.component.ts b/frontend/src/app/features/work-packages/components/filters/query-filters/query-filters.component.ts
index bd45ba86433..fe6b3ce72d8 100644
--- a/frontend/src/app/features/work-packages/components/filters/query-filters/query-filters.component.ts
+++ b/frontend/src/app/features/work-packages/components/filters/query-filters/query-filters.component.ts
@@ -31,7 +31,7 @@ import {
} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { DebouncedEventEmitter } from 'core-app/shared/helpers/rxjs/debounced-event-emitter';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByName } from 'core-app/shared/helpers/angular/tracking-functions';
import { BannersService } from 'core-app/core/enterprise/banners.service';
import { NgSelectComponent } from '@ng-select/ng-select';
import { WorkPackageViewFiltersService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
@@ -63,7 +63,7 @@ export class QueryFiltersComponent extends UntilDestroyedMixin implements OnInit
public focusElementIndex = 0;
- public trackByName = AngularTrackingHelpers.trackByName;
+ public trackByName = trackByName;
public text = {
open_filter: this.I18n.t('js.filter.description.text_open_filter'),
diff --git a/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.html b/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.html
index d4b90bce92b..45711c00e36 100644
--- a/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.html
+++ b/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.html
@@ -12,7 +12,7 @@
></op-principal>
<div>
- <user-link class="op-user-activity--user-name" [user]="user"></user-link>
+ <op-user-link class="op-user-activity--user-name" [user]="user"></op-user-link>
<span class="op-user-activity--date">
{{ isInitial ? text.label_created_on : text.label_updated_on }}
<op-date-time [dateTimeValue]="activity.createdAt"></op-date-time>
diff --git a/frontend/src/app/features/work-packages/components/wp-card-view/services/wp-card-drag-and-drop.service.ts b/frontend/src/app/features/work-packages/components/wp-card-view/services/wp-card-drag-and-drop.service.ts
index 7bf5f946bd7..3ba0e3f5442 100644
--- a/frontend/src/app/features/work-packages/components/wp-card-view/services/wp-card-drag-and-drop.service.ts
+++ b/frontend/src/app/features/work-packages/components/wp-card-view/services/wp-card-drag-and-drop.service.ts
@@ -5,7 +5,7 @@ import { States } from 'core-app/core/states/states.service';
import { WorkPackageCreateService } from 'core-app/features/work-packages/components/wp-new/wp-create.service';
import { WorkPackageInlineCreateService } from 'core-app/features/work-packages/components/wp-inline-create/wp-inline-create.service';
import { DragAndDropService } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.service';
-import { DragAndDropHelpers } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.helpers';
+import { findIndex } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.helpers';
import { WorkPackageCardViewComponent } from 'core-app/features/work-packages/components/wp-card-view/wp-card-view.component';
import { WorkPackageChangeset } from 'core-app/features/work-packages/components/wp-edit/work-package-changeset';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -63,7 +63,7 @@ export class WorkPackageCardDragAndDropService {
accepts: () => this.cardView.dragInto,
onMoved: async (card:HTMLElement) => {
const wpId:string = card.dataset.workPackageId!;
- const toIndex = DragAndDropHelpers.findIndex(card);
+ const toIndex = findIndex(card);
const newOrder = await this.reorderService.move(this.currentOrder, wpId, toIndex);
this.updateOrder(newOrder);
@@ -78,7 +78,7 @@ export class WorkPackageCardDragAndDropService {
},
onAdded: async (card:HTMLElement) => {
const wpId:string = card.dataset.workPackageId!;
- const toIndex = DragAndDropHelpers.findIndex(card);
+ const toIndex = findIndex(card);
const workPackage = await this
.apiV3Service
diff --git a/frontend/src/app/features/work-packages/components/wp-card-view/wp-card-view.component.ts b/frontend/src/app/features/work-packages/components/wp-card-view/wp-card-view.component.ts
index db9ceba37d6..10a0111f26d 100644
--- a/frontend/src/app/features/work-packages/components/wp-card-view/wp-card-view.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-card-view/wp-card-view.component.ts
@@ -15,7 +15,7 @@ import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/q
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { WorkPackageInlineCreateService } from 'core-app/features/work-packages/components/wp-inline-create/wp-inline-create.service';
import { WorkPackageCreateService } from 'core-app/features/work-packages/components/wp-new/wp-create.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByHrefAndProperty } from 'core-app/shared/helpers/angular/tracking-functions';
import { CardHighlightingMode } from 'core-app/features/work-packages/components/wp-fast-table/builders/highlighting/highlighting-mode.const';
import { AuthorisationService } from 'core-app/core/model-auth/model-auth.service';
import { StateService } from '@uirouter/core';
@@ -84,7 +84,7 @@ export class WorkPackageCardViewComponent extends UntilDestroyedMixin implements
@Output() stateLinkClicked = new EventEmitter<{ workPackageId:string, requestedState:string }>();
- public trackByHref = AngularTrackingHelpers.trackByHrefAndProperty('lockVersion');
+ public trackByHref = trackByHrefAndProperty('lockVersion');
public query:QueryResource;
diff --git a/frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.ts b/frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.ts
index e883f1ad308..2d65e001676 100644
--- a/frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.ts
+++ b/frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.ts
@@ -2,12 +2,11 @@ import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { CurrentUserService } from 'core-app/core/current-user/current-user.service';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
import { Injector } from '@angular/core';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { compareByHrefOrString } from 'core-app/shared/helpers/angular/tracking-functions';
import { WorkPackageChangeset } from 'core-app/features/work-packages/components/wp-edit/work-package-changeset';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { FilterOperator } from 'core-app/shared/helpers/api-v3/api-v3-filter-builder';
import { QueryFilterInstanceResource } from 'core-app/features/hal/resources/query-filter-instance-resource';
-import compareByHrefOrString = AngularTrackingHelpers.compareByHrefOrString;
export class WorkPackageFilterValues {
@InjectField() currentUser:CurrentUserService;
diff --git a/frontend/src/app/features/work-packages/components/wp-fast-table/handlers/state/drag-and-drop-transformer.ts b/frontend/src/app/features/work-packages/components/wp-fast-table/handlers/state/drag-and-drop-transformer.ts
index d4deeca2c97..f59783dc474 100644
--- a/frontend/src/app/features/work-packages/components/wp-fast-table/handlers/state/drag-and-drop-transformer.ts
+++ b/frontend/src/app/features/work-packages/components/wp-fast-table/handlers/state/drag-and-drop-transformer.ts
@@ -9,7 +9,7 @@ import { TableDragActionService } from 'core-app/features/work-packages/componen
import { States } from 'core-app/core/states/states.service';
import { tableRowClassName } from 'core-app/features/work-packages/components/wp-fast-table/builders/rows/single-row-builder';
import { DragAndDropService } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.service';
-import { DragAndDropHelpers } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.helpers';
+import { reinsert } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.helpers';
import { WorkPackageViewOrderService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-order.service';
import { BrowserDetector } from 'core-app/core/browser/browser-detector.service';
import { WorkPackagesListService } from 'core-app/features/work-packages/components/wp-list/wp-list.service';
@@ -110,7 +110,7 @@ export class DragAndDropTransformer {
// Restore original element's styles
this.actionService.changeShadowElement(el, true);
// Restore element in from container
- DragAndDropHelpers.reinsert(el, el.dataset.sourceIndex || -1, source);
+ reinsert(el, el.dataset.sourceIndex || -1, source);
}
},
onRemoved: (el:HTMLElement) => {
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 8a629d21b63..1bbda9ec438 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
@@ -9,7 +9,7 @@
type="button"
class="wp-inline-create--add-link"
[class.wp-inline-create--split-link]="hasReferenceClass"
- [focus]="focus"
+ [opAutofocus]="focus"
(click)="handleAddRowClick()"
[attr.aria-label]="text.create"
aria-haspopup="true"
diff --git a/frontend/src/app/features/work-packages/components/wp-query-select/wp-query-select-dropdown.component.ts b/frontend/src/app/features/work-packages/components/wp-query-select/wp-query-select-dropdown.component.ts
index 50eb4e7deb4..d65d5526d45 100644
--- a/frontend/src/app/features/work-packages/components/wp-query-select/wp-query-select-dropdown.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-query-select/wp-query-select-dropdown.component.ts
@@ -301,7 +301,7 @@ export class WorkPackageQuerySelectDropdownComponent extends UntilDestroyedMixin
'ui-autocomplete': 'collapsible-menu--search-ul -inplace',
'ui-menu-divider': 'collapsible-menu--category-icon',
},
- autoFocus: false, // Don't automatically select first entry since we 'open' the autocomplete on page load
+ opAutofocus: false, // Don't automatically select first entry since we 'open' the autocomplete on page load
minLength: 0,
});
}
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 69e2e460448..d997a7c8c61 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
@@ -1,15 +1,16 @@
-<div *ngIf="workPackage && relatedWorkPackage"
- class="relation-row relation-row-{{ relatedWorkPackage.id }}"
- focus-within="'.wp-relations-controls-section button'">
+<div
+ *ngIf="workPackage && relatedWorkPackage"
+ class="relation-row relation-row-{{ relatedWorkPackage.id }}"
+ opFocusWithin=".wp-relations-controls-section button"
+>
<div class="grid-block hierarchy-item">
-
<div class="grid-content medium-2 collapse">
<button
type="button"
class="relation-row--type"
(click)="activateRelationTypeEdit()"
- *ngIf="!userInputs.showRelationTypesForm">
-
+ *ngIf="!userInputs.showRelationTypesForm"
+ >
<span *ngIf="groupByWorkPackageType"
[textContent]="normalizedRelationType"></span>
<span *ngIf="!groupByWorkPackageType"
@@ -22,7 +23,7 @@
[(ngModel)]="selectedRelationType"
(change)="saveRelationType()"
role="listbox"
- focus
+ opAutofocus
(keydown.escape)="cancelRelationTypeEditOnEscape($event)">
<option *ngFor="let relationType of availableRelationTypes"
[textContent]="relationType.label"
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 847fbb319dd..add77268537 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
@@ -6,7 +6,7 @@
<button
type="button"
class="op-link wp-inline-create--add-link relation-create"
- autoFocus
+ opAutofocus
(click)="toggleRelationsCreateForm()"
id="relation--add-relation"
>
@@ -28,7 +28,7 @@
id="relation-type--select"
role="listbox"
[(ngModel)]="selectedRelationType"
- focus>
+ opAutoFocus>
<option *ngFor="let type of relationTypes"
[textContent]="type.label"
[value]="type.name"></option>
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-on-overview.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-on-overview.component.ts
index 85590ad1fd2..1b133325513 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-on-overview.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-on-overview.component.ts
@@ -31,7 +31,7 @@ import { ActivityPanelBaseController } from 'core-app/features/work-packages/com
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { ActivityEntryInfo } from 'core-app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-entry-info';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByProperty } from 'core-app/shared/helpers/angular/tracking-functions';
@Component({
selector: 'newest-activity-on-overview',
@@ -43,7 +43,7 @@ export class NewestActivityOnOverviewComponent extends ActivityPanelBaseControll
public latestActivityInfo:ActivityEntryInfo[] = [];
- public trackByHref = AngularTrackingHelpers.trackByProperty('identifier');
+ public trackByHref = trackByProperty('identifier');
ngOnInit() {
this.workPackageId = this.workPackage.id!;
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts
index 1307a4b9a71..007282fe797 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts
@@ -28,7 +28,7 @@
import { Component } from '@angular/core';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByHrefAndProperty } from 'core-app/shared/helpers/angular/tracking-functions';
import { ActivityPanelBaseController } from 'core-app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller';
@Component({
@@ -40,7 +40,7 @@ export class WorkPackageActivityTabComponent extends ActivityPanelBaseController
public tabName = this.I18n.t('js.work_packages.tabs.activity');
- public trackByHref = AngularTrackingHelpers.trackByHrefAndProperty('version');
+ public trackByHref = trackByHrefAndProperty('version');
ngOnInit() {
this.workPackageId = this.$transition.params('to').workPackageId;
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts
index 4b2706c7068..142a62eb6e1 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts
@@ -36,7 +36,7 @@ import { LoadingIndicatorService } from 'core-app/core/loading-indicator/loading
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { WorkPackageWatchersService } from 'core-app/features/work-packages/components/wp-single-view-tabs/watchers-tab/wp-watchers.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByHref } from 'core-app/shared/helpers/angular/tracking-functions';
import { WorkPackageNotificationService } from 'core-app/features/work-packages/services/notifications/work-package-notification.service';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -51,7 +51,7 @@ export class WorkPackageWatchersTabComponent extends UntilDestroyedMixin impleme
public workPackage:WorkPackageResource;
- public trackByHref = AngularTrackingHelpers.trackByHref;
+ public trackByHref = trackByHref;
public error = false;
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/wp-watcher-entry.html b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/wp-watcher-entry.html
index 4b37f634504..5113a197336 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/wp-watcher-entry.html
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/wp-watcher-entry.html
@@ -1,4 +1,4 @@
-<div class="form--selected-value--container" focus-within="button">
+<div class="form--selected-value--container" opFocusWithin="button">
<span class="form--selected-value">
<span [ngClass]="{'deleting': deleting }">
<a [attr.href]="watcher.showUser.href">
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.html b/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.html
index 980c1bc6333..a2b3f1779a1 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.html
+++ b/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.html
@@ -23,8 +23,8 @@
<!-- The space has to be in an extra span
because otherwise the browser would add a second space after it -->
<span>&nbsp;</span>
- <user-link class="user-link"
- [user]="workPackage.author"></user-link>.
+ <op-user-link class="user-link"
+ [user]="workPackage.author"></op-user-link>.
<span [textContent]="text.infoRow.lastUpdatedOn"></span>
<span>&nbsp;</span>
<op-date-time [dateTimeValue]="workPackage.updatedAt"></op-date-time>.
diff --git a/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.ts b/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.ts
index c3a4ae4632d..b891600c29c 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.ts
@@ -44,7 +44,7 @@ import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/q
import { combineLatest } from 'rxjs';
import { QueryColumn } from 'core-app/features/work-packages/components/wp-query/query-column';
import { WorkPackageViewSortByService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-sort-by.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByHref } from 'core-app/shared/helpers/angular/tracking-functions';
import { WorkPackageCollectionResource } from 'core-app/features/hal/resources/wp-collection-resource';
import { WorkPackageViewGroupByService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-group-by.service';
import { WorkPackageViewColumnsService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-columns.service';
@@ -87,7 +87,7 @@ export class WorkPackagesTableComponent extends UntilDestroyedMixin implements O
@Output() stateLinkClicked = new EventEmitter<{ workPackageId:string, requestedState:string }>();
- public trackByHref = AngularTrackingHelpers.trackByHref;
+ public trackByHref = trackByHref;
public configuration:WorkPackageTableConfiguration;
diff --git a/frontend/src/app/features/work-packages/components/wp-table/wp-table.directive.html b/frontend/src/app/features/work-packages/components/wp-table/wp-table.directive.html
index 0257d8d605f..44bacf276f8 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/wp-table.directive.html
+++ b/frontend/src/app/features/work-packages/components/wp-table/wp-table.directive.html
@@ -4,8 +4,8 @@
<colgroup>
<col *ngIf="configuration.dragAndDropEnabled">
<!-- Generate col elements dynamically(!) for each requested column plus one for the action menu's column. -->
- <col highlight-col *ngFor="let column of [].constructor(columns.length)">
- <col highlight-col *ngIf="configuration.columnMenuEnabled">
+ <col opHighlightCol *ngFor="let column of [].constructor(columns.length)">
+ <col opHighlightCol *ngIf="configuration.columnMenuEnabled">
<col *ngIf="!configuration.columnMenuEnabled">
</colgroup>
<caption class="hidden-for-sighted">
diff --git a/frontend/src/app/features/work-packages/components/wp-tabs/wp-tabs.module.ts b/frontend/src/app/features/work-packages/components/wp-tabs/wp-tabs.module.ts
index 1c3dfe02517..3ee80b60c26 100644
--- a/frontend/src/app/features/work-packages/components/wp-tabs/wp-tabs.module.ts
+++ b/frontend/src/app/features/work-packages/components/wp-tabs/wp-tabs.module.ts
@@ -3,7 +3,6 @@ import { CommonModule } from '@angular/common';
import { UIRouterModule } from '@uirouter/angular';
import { WpTabWrapperComponent } from 'core-app/features/work-packages/components/wp-tabs/components/wp-tab-wrapper/wp-tab-wrapper.component';
import { DynamicModule } from 'ng-dynamic-component';
-import { OpenprojectAccessibilityModule } from 'core-app/shared/directives/a11y/openproject-a11y.module';
import { OpenprojectTabsModule } from 'core-app/shared/components/tabs/openproject-tabs.module';
import { IconModule } from 'core-app/shared/components/icon/icon.module';
import { WpTabsComponent } from './components/wp-tabs/wp-tabs.component';
@@ -17,7 +16,6 @@ import { WpTabsComponent } from './components/wp-tabs/wp-tabs.component';
CommonModule,
UIRouterModule,
DynamicModule,
- OpenprojectAccessibilityModule,
OpenprojectTabsModule,
IconModule,
],
diff --git a/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html b/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html
index 05ea589c3ae..7a576699802 100644
--- a/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html
+++ b/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html
@@ -51,7 +51,7 @@
</div>
<div class="work-packages-full-view--split-right work-packages-tab-view--overflow">
<div class="work-packages--panel-inner">
- <span class="hidden-for-sighted" tabindex="-1" focus [textContent]="focusAnchorLabel"></span>
+ <span class="hidden-for-sighted" tabindex="-1" opAutofocus [textContent]="focusAnchorLabel"></span>
<op-wp-tabs [workPackage]="workPackage" view="full"></op-wp-tabs>
<div class="tabcontent" ui-view>
</div>
diff --git a/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.html b/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.html
index e93428f3401..610a72f6256 100644
--- a/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.html
+++ b/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.html
@@ -3,7 +3,7 @@
*ngIf="workPackage">
<op-wp-tabs [workPackage]="workPackage" view="split"></op-wp-tabs>
<div class="work-packages--details-content work-packages-tab-view--overflow" *ngIf="workPackage">
- <span class="hidden-for-sighted" tabindex="-1" focus="shouldFocus" [textContent]="focusAnchorLabel">
+ <span class="hidden-for-sighted" tabindex="-1" [opAutofocus]="shouldFocus" [textContent]="focusAnchorLabel">
</span>
<wp-breadcrumb [workPackage]="workPackage"></wp-breadcrumb>
diff --git a/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service.ts b/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service.ts
index 9d561d52b11..7ea37451363 100644
--- a/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service.ts
+++ b/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service.ts
@@ -61,7 +61,7 @@ export class WorkPackageViewFiltersService extends WorkPackageQueryStateService<
'subjectOrId',
'subjectOr',
'manualSort',
- 'typeahead'
+ 'typeahead',
];
/** Flag state to determine whether the filters are incomplete */
diff --git a/frontend/src/app/shared/components/attachments/attachment-list/attachment-list-item.html b/frontend/src/app/shared/components/attachments/attachment-list/attachment-list-item.html
index a096b4f2318..7e3d7440231 100644
--- a/frontend/src/app/shared/components/attachments/attachment-list/attachment-list-item.html
+++ b/frontend/src/app/shared/components/attachments/attachment-list/attachment-list-item.html
@@ -1,9 +1,10 @@
-<li class="form--selected-value--container work-package--attachments--draggable-item"
- focus-within
- draggable="true"
- (dragstart)="setDragData($event)"
- [title]="text.dragHint"
- focusWithinSelector=".inplace-editing--trigger-icon">
+<li
+ class="form--selected-value--container work-package--attachments--draggable-item"
+ opFocusWithin=".inplace-editing--trigger-icon"
+ draggable="true"
+ (dragstart)="setDragData($event)"
+ [title]="text.dragHint"
+>
<span class="form--selected-value">
<op-icon icon-classes="icon-context icon-attachment"></op-icon>
<a
diff --git a/frontend/src/app/shared/components/attachments/attachment-list/attachment-list.component.ts b/frontend/src/app/shared/components/attachments/attachment-list/attachment-list.component.ts
index ad444cfa62b..edb2f12c88f 100644
--- a/frontend/src/app/shared/components/attachments/attachment-list/attachment-list.component.ts
+++ b/frontend/src/app/shared/components/attachments/attachment-list/attachment-list.component.ts
@@ -33,7 +33,7 @@ import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
import { filter } from 'rxjs/operators';
import { States } from 'core-app/core/states/states.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByHref } from 'core-app/shared/helpers/angular/tracking-functions';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
@Component({
@@ -45,7 +45,7 @@ export class AttachmentListComponent extends UntilDestroyedMixin implements OnIn
@Input() public destroyImmediately = true;
- trackByHref = AngularTrackingHelpers.trackByHref;
+ trackByHref = trackByHref;
attachments:HalResource[] = [];
diff --git a/frontend/src/app/shared/components/attachments/openproject-attachments.module.ts b/frontend/src/app/shared/components/attachments/openproject-attachments.module.ts
index 2c819e03b12..5c2ce4df79e 100644
--- a/frontend/src/app/shared/components/attachments/openproject-attachments.module.ts
+++ b/frontend/src/app/shared/components/attachments/openproject-attachments.module.ts
@@ -30,7 +30,6 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IconModule } from 'core-app/shared/components/icon/icon.module';
-import { OpenprojectAccessibilityModule } from 'core-app/shared/directives/a11y/openproject-a11y.module';
import { AttachmentsComponent } from './attachments.component';
import { AttachmentListComponent } from './attachment-list/attachment-list.component';
@@ -42,7 +41,6 @@ import { AuthoringComponent } from './authoring/authoring.component';
imports: [
CommonModule,
IconModule,
- OpenprojectAccessibilityModule,
],
declarations: [
AttachmentsComponent,
diff --git a/frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.module.ts b/frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.module.ts
index f77f6a8b252..8b20a555941 100644
--- a/frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.module.ts
+++ b/frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.module.ts
@@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { OpenprojectModalModule } from 'core-app/shared/components/modal/modal.module';
import { OpenprojectAttachmentsModule } from 'core-app/shared/components/attachments/openproject-attachments.module';
-import { OpenprojectAccessibilityModule } from 'core-app/shared/directives/a11y/openproject-a11y.module';
import { IconModule } from 'core-app/shared/components/icon/icon.module';
import { AttributeHelpTextComponent } from './attribute-help-text.component';
@@ -13,7 +12,6 @@ import { AttributeHelpTextModalComponent } from './attribute-help-text.modal';
CommonModule,
OpenprojectModalModule,
OpenprojectAttachmentsModule,
- OpenprojectAccessibilityModule,
IconModule,
],
declarations: [
diff --git a/frontend/src/app/shared/components/autocompleter/create-autocompleter/create-autocompleter.component.ts b/frontend/src/app/shared/components/autocompleter/create-autocompleter/create-autocompleter.component.ts
index 4b7564f9212..a81df0ef0ed 100644
--- a/frontend/src/app/shared/components/autocompleter/create-autocompleter/create-autocompleter.component.ts
+++ b/frontend/src/app/shared/components/autocompleter/create-autocompleter/create-autocompleter.component.ts
@@ -47,7 +47,7 @@ import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destr
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { Subject } from 'rxjs';
import { PrincipalHelper } from 'core-app/shared/components/principal/principal-helper';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { compareByHref } from 'core-app/shared/helpers/angular/tracking-functions';
import { filter } from 'rxjs/operators';
export interface CreateAutocompleterValueOption {
@@ -109,7 +109,7 @@ export class CreateAutocompleterComponent extends UntilDestroyedMixin implements
@InjectField() readonly pathHelper:PathHelperService;
- public compareByHref = AngularTrackingHelpers.compareByHref;
+ public compareByHref = compareByHref;
public text:{ [key:string]:string } = {};
diff --git a/frontend/src/app/shared/components/autocompleter/draggable-autocomplete/draggable-autocomplete.component.ts b/frontend/src/app/shared/components/autocompleter/draggable-autocomplete/draggable-autocomplete.component.ts
index a325179a853..60cc67a28e2 100644
--- a/frontend/src/app/shared/components/autocompleter/draggable-autocomplete/draggable-autocomplete.component.ts
+++ b/frontend/src/app/shared/components/autocompleter/draggable-autocomplete/draggable-autocomplete.component.ts
@@ -14,7 +14,7 @@ import { DragulaService, Group } from 'ng2-dragula';
import { DomAutoscrollService } from 'core-app/shared/helpers/drag-and-drop/dom-autoscroll.service';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { merge } from 'rxjs';
-import { DomHelpers } from 'core-app/shared/helpers/dom/set-window-cursor.helper';
+import { setBodyCursor } from 'core-app/shared/helpers/dom/set-window-cursor.helper';
export interface DraggableOption {
name:string;
@@ -67,7 +67,7 @@ export class DraggableAutocompleteComponent extends UntilDestroyedMixin implemen
// Set cursor when dragging
this.dragula.drag('columns')
.pipe(this.untilDestroyed())
- .subscribe(() => DomHelpers.setBodyCursor('move', 'important'));
+ .subscribe(() => setBodyCursor('move', 'important'));
// Reset cursor when cancel or dropped
merge(
@@ -75,7 +75,7 @@ export class DraggableAutocompleteComponent extends UntilDestroyedMixin implemen
this.dragula.cancel('columns'),
)
.pipe(this.untilDestroyed())
- .subscribe(() => DomHelpers.setBodyCursor('auto'));
+ .subscribe(() => setBodyCursor('auto'));
// Setup autoscroll
const that = this;
diff --git a/frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.ts b/frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.ts
index 6e6a077b1b7..834fe5687c6 100644
--- a/frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.ts
+++ b/frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.ts
@@ -14,7 +14,13 @@ import {
SimpleChanges,
} from '@angular/core';
import { DropdownPosition, NgSelectComponent } from '@ng-select/ng-select';
-import { Observable, NEVER, of, Subject, combineLatest, merge } from 'rxjs';
+import {
+ Observable,
+ NEVER,
+ of,
+ Subject,
+ merge,
+} from 'rxjs';
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
import { GroupValueFn } from '@ng-select/ng-select/lib/ng-select.component';
@@ -22,7 +28,7 @@ import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { Highlighting } from 'core-app/features/work-packages/components/wp-fast-table/builders/highlighting/highlighting.functions';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { compareByHrefOrString } from 'core-app/shared/helpers/angular/tracking-functions';
import { OpAutocompleterFooterTemplateDirective } from 'core-app/shared/components/autocompleter/autocompleter-footer-template/op-autocompleter-footer-template.directive';
import { OpAutocompleterService } from './services/op-autocompleter.service';
@@ -73,6 +79,7 @@ export class OpAutocompleterComponent extends UntilDestroyedMixin implements Aft
@Input() public id?:string;
@Input() public items?:IOPAutocompleterOption[]|HalResource[];
+
private items$ = new Subject();
@Input() public clearSearchOnAdd?:boolean = true;
@@ -182,7 +189,7 @@ export class OpAutocompleterComponent extends UntilDestroyedMixin implements Aft
@Output() public scrollToEnd = new EventEmitter();
- public compareByHrefOrString = AngularTrackingHelpers.compareByHrefOrString;
+ public compareByHrefOrString = compareByHrefOrString;
public active:Set<string>;
@@ -267,7 +274,7 @@ export class OpAutocompleterComponent extends UntilDestroyedMixin implements Aft
}
}
- public opened(val: any) {
+ public opened(_:unknown) { // eslint-disable-line no-unused-vars
if (this.openDirectly) {
this.results$ = this.defaultData
? (this.opAutocompleterService.loadData('', this.resource, this.filters, this.searchKey))
@@ -297,7 +304,7 @@ export class OpAutocompleterComponent extends UntilDestroyedMixin implements Aft
});
}
- public closed(val:any) {
+ public closed(_:unknown) { // eslint-disable-line no-unused-vars
this.close.emit();
}
diff --git a/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.ts b/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.ts
index d1c53d3f45e..09fd810129c 100644
--- a/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.ts
+++ b/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.ts
@@ -18,9 +18,9 @@ import { DynamicFieldsService } from 'core-app/shared/components/dynamic-forms/s
import { FormGroup } from '@angular/forms';
import { HttpErrorResponse } from '@angular/common/http';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
+import { ConfirmDialogService } from 'core-app/shared/components/modals/confirm-dialog/confirm-dialog.service';
import { IDynamicFieldGroupConfig, IOPDynamicFormSettings, IOPFormlyFieldSettings } from '../../typings';
import { DynamicFormService } from '../../services/dynamic-form/dynamic-form.service';
-import { ConfirmDialogService } from "core-app/shared/components/modals/confirm-dialog/confirm-dialog.service";
/**
* SETTINGS:
@@ -288,7 +288,6 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
return this._dynamicFormService.validateForm$(this.form, this.formEndpoint);
}
-
handleCancel() {
if (this.form.dirty) {
this._confirmDialogService.confirm({
diff --git a/frontend/src/app/shared/components/dynamic-forms/components/dynamic-inputs/formattable-textarea-input/components/formattable-control/formattable-control.component.ts b/frontend/src/app/shared/components/dynamic-forms/components/dynamic-inputs/formattable-textarea-input/components/formattable-control/formattable-control.component.ts
index 62db18388de..de61c7fa610 100644
--- a/frontend/src/app/shared/components/dynamic-forms/components/dynamic-inputs/formattable-textarea-input/components/formattable-control/formattable-control.component.ts
+++ b/frontend/src/app/shared/components/dynamic-forms/components/dynamic-inputs/formattable-textarea-input/components/formattable-control/formattable-control.component.ts
@@ -4,11 +4,11 @@ import {
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { FormlyTemplateOptions } from '@ngx-formly/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
-import { OpCkeditorComponent } from "core-app/shared/components/editor/components/ckeditor/op-ckeditor.component";
+import { OpCkeditorComponent } from 'core-app/shared/components/editor/components/ckeditor/op-ckeditor.component';
import {
ICKEditorContext,
- ICKEditorInstance
-} from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
+ ICKEditorInstance,
+} from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
@Component({
selector: 'op-formattable-control',
diff --git a/frontend/src/app/shared/components/editable-toolbar-title/editable-toolbar-title.component.ts b/frontend/src/app/shared/components/editable-toolbar-title/editable-toolbar-title.component.ts
index 9eb52fc73e5..25744d8f129 100644
--- a/frontend/src/app/shared/components/editable-toolbar-title/editable-toolbar-title.component.ts
+++ b/frontend/src/app/shared/components/editable-toolbar-title/editable-toolbar-title.component.ts
@@ -38,7 +38,7 @@ import {
ViewChild,
} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { ContainHelpers } from 'core-app/shared/directives/focus/contain-helpers';
+import { whenOutside } from 'core-app/shared/directives/focus/contain-helpers';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
export const triggerEditingEvent = 'op:selectableTitle:trigger';
@@ -138,7 +138,7 @@ export class EditableToolbarTitleComponent implements OnInit, OnChanges {
}
public saveWhenFocusOutside($event:FocusEvent) {
- ContainHelpers.whenOutside(this.elementRef.nativeElement, () => this.save($event));
+ whenOutside(this.elementRef.nativeElement, () => this.save($event));
}
public reset() {
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 7494bf5881a..b235756580d 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
@@ -14,7 +14,7 @@
type="text"
aria-required="true"
[attr.name]="selectableTitleIdentifier"
- [focus]="this.initialFocus || undefined"
+ [opAutofocus]="this.initialFocus || undefined"
(focus)="onFocus($event)"
(blur)="onBlur()"
(keydown.escape)="reset($event)"
diff --git a/frontend/src/app/shared/components/editor/components/ckeditor-augmented-textarea/ckeditor-augmented-textarea.component.ts b/frontend/src/app/shared/components/editor/components/ckeditor-augmented-textarea/ckeditor-augmented-textarea.component.ts
index 0778764e1d7..430494825c0 100644
--- a/frontend/src/app/shared/components/editor/components/ckeditor-augmented-textarea/ckeditor-augmented-textarea.component.ts
+++ b/frontend/src/app/shared/components/editor/components/ckeditor-augmented-textarea/ckeditor-augmented-textarea.component.ts
@@ -42,10 +42,10 @@ import {
} from 'core-app/shared/components/editor/components/ckeditor/ckeditor-setup.service';
import { OpCkeditorComponent } from 'core-app/shared/components/editor/components/ckeditor/op-ckeditor.component';
import { componentDestroyed } from '@w11k/ngx-componentdestroyed';
-import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';import {
+import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin'; import {
ICKEditorContext,
- ICKEditorInstance
-} from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
+ ICKEditorInstance,
+} from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
export const ckeditorAugmentedTextareaSelector = 'ckeditor-augmented-textarea';
diff --git a/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor-setup.service.ts b/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor-setup.service.ts
index 64eef2805bb..a72880685c8 100644
--- a/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor-setup.service.ts
+++ b/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor-setup.service.ts
@@ -1,11 +1,11 @@
-import { PathHelperService } from "core-app/core/path-helper/path-helper.service";
-import { Injectable } from "@angular/core";
+import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
+import { Injectable } from '@angular/core';
import {
ICKEditorContext,
ICKEditorStatic,
- ICKEditorWatchdog
-} from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
-import { Constructor } from "@angular/cdk/schematics";
+ ICKEditorWatchdog,
+} from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
+import { Constructor } from '@angular/cdk/schematics';
export type ICKEditorType = 'full'|'constrained';
export type ICKEditorMacroType = 'none'|'resource'|'full'|boolean|string[];
@@ -36,7 +36,7 @@ export class CKEditorSetupService {
*/
public async create(
wrapper:HTMLElement, context:ICKEditorContext,
- initialData:string|null = null
+ initialData:string|null = null,
):Promise<ICKEditorWatchdog> {
// Load the bundle
await CKEditorSetupService.load();
@@ -51,7 +51,7 @@ export class CKEditorSetupService {
const config = {
openProject: this.createConfig(context),
- initialData,
+ initialData,
language: {
content: contentLanguage,
},
@@ -60,7 +60,7 @@ export class CKEditorSetupService {
return this
.createWatchdog(editorClass, contentWrapper, config)
.then((watchdog:ICKEditorWatchdog) => {
- const editor = watchdog.editor;
+ const { editor } = watchdog;
toolbarWrapper.appendChild(editor.ui.view.toolbar.element);
// Allow custom events on wrapper to set/get data for debugging
diff --git a/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor.types.ts b/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor.types.ts
index b79cc911fd1..6ad99234a92 100644
--- a/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor.types.ts
+++ b/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor.types.ts
@@ -1,8 +1,8 @@
-import { HalResource } from "core-app/features/hal/resources/hal-resource";
+import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import {
ICKEditorMacroType,
- ICKEditorType
-} from "core-app/shared/components/editor/components/ckeditor/ckeditor-setup.service";
+ ICKEditorType,
+} from 'core-app/shared/components/editor/components/ckeditor/ckeditor-setup.service';
export interface ICKEditorInstance {
getData(options:{ trim:boolean }):string;
@@ -66,4 +66,4 @@ export interface ICKEditorContext {
};
// context link to append on preview requests
previewContext?:string;
-}
\ No newline at end of file
+}
diff --git a/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.component.ts b/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.component.ts
index ea7c3610528..fb93b0ec668 100644
--- a/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.component.ts
+++ b/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.component.ts
@@ -34,10 +34,9 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import {
ICKEditorContext,
- ICKEditorInstance, ICKEditorWatchdog
-} from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
-import { CKEditorSetupService } from "core-app/shared/components/editor/components/ckeditor/ckeditor-setup.service";
-
+ ICKEditorInstance, ICKEditorWatchdog,
+} from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
+import { CKEditorSetupService } from 'core-app/shared/components/editor/components/ckeditor/ckeditor-setup.service';
declare module 'codemirror';
@@ -76,6 +75,7 @@ export class OpCkeditorComponent implements OnInit, OnDestroy {
// CKEditor instance once initialized
public watchdog:ICKEditorWatchdog;
+
public ckEditorInstance:ICKEditorInstance;
public error:string|null = null;
@@ -109,10 +109,10 @@ export class OpCkeditorComponent implements OnInit, OnDestroy {
private $element:JQuery;
constructor(private readonly elementRef:ElementRef,
- private readonly Notifications:NotificationsService,
- private readonly I18n:I18nService,
- private readonly configurationService:ConfigurationService,
- private readonly ckEditorSetup:CKEditorSetupService) {
+ private readonly Notifications:NotificationsService,
+ private readonly I18n:I18nService,
+ private readonly configurationService:ConfigurationService,
+ private readonly ckEditorSetup:CKEditorSetupService) {
}
/**
@@ -182,7 +182,7 @@ export class OpCkeditorComponent implements OnInit, OnDestroy {
try {
this.watchdog?.destroy();
} catch (e) {
- console.error(`Failed to destroy CKEditor instance: ${e}`)
+ console.error('Failed to destroy CKEditor instance:', e);
}
}
diff --git a/frontend/src/app/shared/components/fields/edit/field-types/formattable-edit-field/formattable-edit-field.component.ts b/frontend/src/app/shared/components/fields/edit/field-types/formattable-edit-field/formattable-edit-field.component.ts
index 29f4b3c0dae..68f052ed98d 100644
--- a/frontend/src/app/shared/components/fields/edit/field-types/formattable-edit-field/formattable-edit-field.component.ts
+++ b/frontend/src/app/shared/components/fields/edit/field-types/formattable-edit-field/formattable-edit-field.component.ts
@@ -32,9 +32,8 @@ import { EditFieldComponent } from 'core-app/shared/components/fields/edit/edit-
import { OpCkeditorComponent } from 'core-app/shared/components/editor/components/ckeditor/op-ckeditor.component';
import {
ICKEditorContext,
- ICKEditorInstance
-} from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
-
+ ICKEditorInstance,
+} from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
@Component({
templateUrl: './formattable-edit-field.component.html',
diff --git a/frontend/src/app/shared/components/fields/edit/field-types/text-edit-field.component.html b/frontend/src/app/shared/components/fields/edit/field-types/text-edit-field.component.html
index ca94de76c5c..759be497e12 100644
--- a/frontend/src/app/shared/components/fields/edit/field-types/text-edit-field.component.html
+++ b/frontend/src/app/shared/components/fields/edit/field-types/text-edit-field.component.html
@@ -1,6 +1,6 @@
<input type="text"
class="inline-edit--field op-input"
- [focus]="shouldFocus"
+ [opAutofocus]="shouldFocus"
[attr.aria-required]="required"
[attr.required]="required"
[disabled]="inFlight"
diff --git a/frontend/src/app/shared/components/fields/openproject-fields.module.ts b/frontend/src/app/shared/components/fields/openproject-fields.module.ts
index 1b311487c1e..5b788b49a84 100644
--- a/frontend/src/app/shared/components/fields/openproject-fields.module.ts
+++ b/frontend/src/app/shared/components/fields/openproject-fields.module.ts
@@ -28,7 +28,6 @@
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
-import { OpenprojectAccessibilityModule } from 'core-app/shared/directives/a11y/openproject-a11y.module';
import { OpenprojectModalModule } from 'core-app/shared/components/modal/modal.module';
import { OpenprojectEditorModule } from 'core-app/shared/components/editor/openproject-editor.module';
import { OpenprojectAttachmentsModule } from 'core-app/shared/components/attachments/openproject-attachments.module';
@@ -67,7 +66,6 @@ import { EditFieldControlsModule } from 'core-app/shared/components/fields/edit/
CommonModule,
OPSharedModule,
OpenprojectAttachmentsModule,
- OpenprojectAccessibilityModule,
OpenprojectEditorModule,
OpenprojectModalModule,
OpenprojectAutocompleterModule,
diff --git a/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text-edit-field.service.ts b/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text-edit-field.service.ts
index a652a758933..a39d3dfb418 100644
--- a/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text-edit-field.service.ts
+++ b/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text-edit-field.service.ts
@@ -8,7 +8,7 @@ import { HalResourceService } from 'core-app/features/hal/services/hal-resource.
import { ResourceChangeset } from 'core-app/shared/components/fields/changeset/resource-changeset';
import { SchemaCacheService } from 'core-app/core/schemas/schema-cache.service';
import { UploadFile } from 'core-app/core/file-upload/op-file-upload.service';
-import { ICKEditorContext } from "core-app/shared/components/editor/components/ckeditor/ckeditor.types";
+import { ICKEditorContext } from 'core-app/shared/components/editor/components/ckeditor/ckeditor.types';
@Injectable()
export class CustomTextEditFieldService extends EditFieldHandler {
diff --git a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
index d19d53a7fd7..9af4d6a40e6 100644
--- a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
+++ b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
@@ -53,7 +53,7 @@ export class TimeEntriesCurrentUserConfigurationModalComponent extends OpModalCo
}
ngOnInit() {
- let localDayOptions = this.locals.options.days
+ const localDayOptions = this.locals.options.days;
this.daysOriginalCheckedValues = localDayOptions.length > 0 ? localDayOptions : Array.from({ length: 7 }, () => true);
this.days = this.timeEntriesCurrentUserConfigurationModalService.getOrderedDaysData(this.daysOriginalCheckedValues);
}
diff --git a/frontend/src/app/shared/components/grids/widgets/time-entries/list/time-entries-list.component.html b/frontend/src/app/shared/components/grids/widgets/time-entries/list/time-entries-list.component.html
index f93a504d43f..d09981d42cb 100644
--- a/frontend/src/app/shared/components/grids/widgets/time-entries/list/time-entries-list.component.html
+++ b/frontend/src/app/shared/components/grids/widgets/time-entries/list/time-entries-list.component.html
@@ -20,10 +20,10 @@
<div class="generic-table--results-container" *ngIf="anyEntries">
<table class="generic-table time-entries">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead class="-sticky">
diff --git a/frontend/src/app/shared/components/grids/widgets/wp-graph/wp-graph.component.html b/frontend/src/app/shared/components/grids/widgets/wp-graph/wp-graph.component.html
index 1889abf47b8..976d4a7c6c1 100644
--- a/frontend/src/app/shared/components/grids/widgets/wp-graph/wp-graph.component.html
+++ b/frontend/src/app/shared/components/grids/widgets/wp-graph/wp-graph.component.html
@@ -9,7 +9,7 @@
</widget-wp-graph-menu>
</widget-header>
-<wp-embedded-graph class='grid--widget-content -no-overflow'
+<op-wp-embedded-graph class='grid--widget-content -no-overflow'
[datasets]="datasets"
[chartType]="chartType">
-</wp-embedded-graph>
+</op-wp-embedded-graph>
diff --git a/frontend/src/app/shared/components/hide-section/add-section-dropdown/add-section-dropdown.component.ts b/frontend/src/app/shared/components/hide-section/add-section-dropdown/add-section-dropdown.component.ts
index 428fff62a0b..9291068ebcd 100644
--- a/frontend/src/app/shared/components/hide-section/add-section-dropdown/add-section-dropdown.component.ts
+++ b/frontend/src/app/shared/components/hide-section/add-section-dropdown/add-section-dropdown.component.ts
@@ -34,7 +34,7 @@ import {
HideSectionDefinition,
HideSectionService,
} from 'core-app/shared/components/hide-section/hide-section.service';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByProperty } from 'core-app/shared/helpers/angular/tracking-functions';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
export const addSectionDropdownSelector = 'add-section-dropdown';
@@ -46,7 +46,7 @@ export const addSectionDropdownSelector = 'add-section-dropdown';
export class AddSectionDropdownComponent extends UntilDestroyedMixin implements OnInit {
@ViewChild('fallbackOption', { static: true }) private option:ElementRef;
- trackByKey = AngularTrackingHelpers.trackByProperty('key');
+ trackByKey = trackByProperty('key');
selectable:HideSectionDefinition[] = [];
diff --git a/frontend/src/app/shared/components/resizer/resizer.component.ts b/frontend/src/app/shared/components/resizer/resizer.component.ts
index 6f5bcde0c37..7d6dbd3384e 100644
--- a/frontend/src/app/shared/components/resizer/resizer.component.ts
+++ b/frontend/src/app/shared/components/resizer/resizer.component.ts
@@ -1,7 +1,7 @@
import {
Component, EventEmitter, HostListener, Input, OnDestroy, Output,
} from '@angular/core';
-import { DomHelpers } from 'core-app/shared/helpers/dom/set-window-cursor.helper';
+import { setBodyCursor } from 'core-app/shared/helpers/dom/set-window-cursor.helper';
export interface ResizeDelta {
origin:any;
@@ -121,11 +121,11 @@ export class ResizerComponent implements OnDestroy {
}
private setResizeCursor() {
- DomHelpers.setBodyCursor(this.cursorClass, 'important');
+ setBodyCursor(this.cursorClass, 'important');
}
private setAutoCursor() {
- DomHelpers.setBodyCursor('auto');
+ setBodyCursor('auto');
}
private buildDelta(event:any):ResizeDelta {
diff --git a/frontend/src/app/shared/components/tabs/scrollable-tabs/scrollable-tabs.component.ts b/frontend/src/app/shared/components/tabs/scrollable-tabs/scrollable-tabs.component.ts
index 9025a3a2707..be205fadd57 100644
--- a/frontend/src/app/shared/components/tabs/scrollable-tabs/scrollable-tabs.component.ts
+++ b/frontend/src/app/shared/components/tabs/scrollable-tabs/scrollable-tabs.component.ts
@@ -12,7 +12,7 @@ import {
ViewChild,
} from '@angular/core';
import { TabDefinition } from 'core-app/shared/components/tabs/tab.interface';
-import { AngularTrackingHelpers } from 'core-app/shared/helpers/angular/tracking-functions';
+import { trackByProperty } from 'core-app/shared/helpers/angular/tracking-functions';
@Component({
templateUrl: 'scrollable-tabs.component.html',
@@ -41,7 +41,7 @@ export class ScrollableTabsComponent implements AfterViewInit, OnChanges {
@Output() public tabSelected = new EventEmitter<TabDefinition>();
- trackById = AngularTrackingHelpers.trackByProperty('id');
+ trackById = trackByProperty('id');
private container:Element;
diff --git a/frontend/src/app/shared/components/user-link/user-link.component.ts b/frontend/src/app/shared/components/user-link/user-link.component.ts
index 8c05854b89d..ede37c9eed0 100644
--- a/frontend/src/app/shared/components/user-link/user-link.component.ts
+++ b/frontend/src/app/shared/components/user-link/user-link.component.ts
@@ -31,7 +31,7 @@ import { UserResource } from 'core-app/features/hal/resources/user-resource';
import { I18nService } from 'core-app/core/i18n/i18n.service';
@Component({
- selector: 'user-link',
+ selector: 'op-user-link',
template: `
<a *ngIf="href"
[attr.href]="href"
diff --git a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/filters-tab-inner.component.ts b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/filters-tab-inner.component.ts
index 5d80f111b0d..e6c59fbc596 100644
--- a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/filters-tab-inner.component.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/filters-tab-inner.component.ts
@@ -9,7 +9,7 @@ import { QuerySpacedTabComponent } from 'core-app/shared/components/work-package
import { WorkPackageFiltersService } from 'core-app/features/work-packages/components/filters/wp-filters/wp-filters.service';
@Component({
- selector: 'filters-tab-inner',
+ selector: 'op-filters-tab-inner',
templateUrl: './filters-tab-inner.component.html',
})
export class WpGraphConfigurationFiltersTabInnerComponent extends QuerySpacedTabComponent implements TabComponent {
diff --git a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/filters-tab.component.html b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/filters-tab.component.html
index 88b56760ee1..fe74cc492cd 100644
--- a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/filters-tab.component.html
+++ b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/filters-tab.component.html
@@ -1,3 +1,3 @@
<ng-container wp-isolated-query-space>
- <filters-tab-inner #tabInner></filters-tab-inner>
+ <op-filters-tab-inner #tabInner></op-filters-tab-inner>
</ng-container>
diff --git a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/settings-tab-inner.component.ts b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/settings-tab-inner.component.ts
index e8347fd2e4a..220606799c1 100644
--- a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/settings-tab-inner.component.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/settings-tab-inner.component.ts
@@ -14,7 +14,7 @@ interface OpChartType {
}
@Component({
- selector: 'settings-tab-inner',
+ selector: 'op-settings-tab-inner',
templateUrl: './settings-tab-inner.component.html',
})
export class WpGraphConfigurationSettingsTabInnerComponent extends QuerySpacedTabComponent implements TabComponent {
diff --git a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/settings-tab.component.html b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/settings-tab.component.html
index 4a89b6362b0..1366b4ce1d0 100644
--- a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/settings-tab.component.html
+++ b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/tabs/settings-tab.component.html
@@ -1,4 +1,4 @@
<ng-container wp-isolated-query-space>
- <settings-tab-inner #tabInner></settings-tab-inner>
+ <op-settings-tab-inner #tabInner></op-settings-tab-inner>
</ng-container>
diff --git a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts
index 75fdada659c..0ee311944ee 100644
--- a/frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts
@@ -61,7 +61,8 @@ export class WpGraphConfigurationModalComponent extends OpModalComponent impleme
// And a reference to the actual portal host interface
public tabPortalHost:TabPortalOutlet;
- constructor(@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
+ constructor(
+ @Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
@Optional() @Inject(WpTableConfigurationModalPrependToken) public prependModalComponent:ComponentType<any>|null,
readonly I18n:I18nService,
readonly injector:Injector,
@@ -70,9 +71,10 @@ export class WpGraphConfigurationModalComponent extends OpModalComponent impleme
readonly loadingIndicator:LoadingIndicatorService,
readonly notificationService:WorkPackageNotificationService,
readonly cdRef:ChangeDetectorRef,
- readonly ConfigurationService:ConfigurationService,
+ readonly configurationService:ConfigurationService,
readonly elementRef:ElementRef,
- readonly graphConfiguration:WpGraphConfigurationService) {
+ readonly graphConfiguration:WpGraphConfigurationService,
+ ) {
super(locals, cdRef, elementRef);
}
diff --git a/frontend/src/app/shared/components/work-package-graphs/configuration/wp-graph-configuration.service.ts b/frontend/src/app/shared/components/work-package-graphs/configuration/wp-graph-configuration.service.ts
index 3c9debb45e3..7289e1aa37d 100644
--- a/frontend/src/app/shared/components/work-package-graphs/configuration/wp-graph-configuration.service.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/configuration/wp-graph-configuration.service.ts
@@ -23,11 +23,12 @@ export class WpGraphConfigurationService {
private _formsPromise:Promise<void[]>|null;
- constructor(readonly I18n:I18nService,
+ constructor(
+ readonly I18n:I18nService,
readonly apiv3Service:APIV3Service,
readonly notificationService:WorkPackageNotificationService,
- readonly currentProject:CurrentProjectService) {
- }
+ readonly currentProject:CurrentProjectService,
+ ) { }
public persistAndReload():Promise<unknown> {
return this
@@ -104,6 +105,7 @@ export class WpGraphConfigurationService {
.toPromise()
.then((query) => {
if (params.name) {
+ // eslint-ignore-next-line no-param-reassign
query.name = params.name;
}
this.configuration.queries.push(query);
@@ -161,7 +163,7 @@ export class WpGraphConfigurationService {
.form
.load(query)
.toPromise()
- .then(([form, _]) => {
+ .then(([form]) => {
this._forms[query.id as string] = form;
})
.catch((error) => this.notificationService.handleRawError(error)));
diff --git a/frontend/src/app/shared/components/work-package-graphs/configuration/wp-graph-configuration.ts b/frontend/src/app/shared/components/work-package-graphs/configuration/wp-graph-configuration.ts
index 8cdb0dac3b8..f35a3ffccfe 100644
--- a/frontend/src/app/shared/components/work-package-graphs/configuration/wp-graph-configuration.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/configuration/wp-graph-configuration.ts
@@ -18,9 +18,11 @@ export interface WpGraphConfiguration {
export class WpGraphConfiguration implements WpGraphConfiguration {
public queries:QueryResource[] = [];
- constructor(public queryParams:WpGraphQueryParams[],
+ constructor(
+ public queryParams:WpGraphQueryParams[],
public chartOptions:ChartOptions,
- public chartType:ChartType) {
+ public chartType:ChartType,
+ ) {
this.chartType = this.chartType || 'horizontalBar';
}
@@ -38,3 +40,4 @@ export class WpGraphConfiguration implements WpGraphConfiguration {
};
}
}
+
diff --git a/frontend/src/app/shared/components/work-package-graphs/embedded/wp-embedded-graph.component.ts b/frontend/src/app/shared/components/work-package-graphs/embedded/wp-embedded-graph.component.ts
index c46f99b5028..c8bbe80f136 100644
--- a/frontend/src/app/shared/components/work-package-graphs/embedded/wp-embedded-graph.component.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/embedded/wp-embedded-graph.component.ts
@@ -16,16 +16,16 @@ interface ChartDataSet {
}
@Component({
- selector: 'wp-embedded-graph',
+ selector: 'op-wp-embedded-graph',
templateUrl: './wp-embedded-graph.html',
styleUrls: ['./wp-embedded-graph.component.sass'],
})
export class WorkPackageEmbeddedGraphComponent {
@Input() public datasets:WorkPackageEmbeddedGraphDataset[];
- @Input('chartOptions') public inputChartOptions:ChartOptions;
+ @Input() public chartOptions:ChartOptions;
- @Input('chartType') chartType:ChartType = 'horizontalBar';
+ @Input() chartType:ChartType = 'horizontalBar';
public configuration:WorkPackageTableConfiguration;
@@ -37,7 +37,7 @@ export class WorkPackageEmbeddedGraphComponent {
public chartData:ChartDataSet[] = [];
- public chartOptions:ChartOptions;
+ public internalChartOptions:ChartOptions;
public initialized = false;
@@ -67,10 +67,10 @@ export class WorkPackageEmbeddedGraphComponent {
}, [])) as string[];
const labelCountMaps = this.datasets.map((dataset) => {
- const countMap = (dataset.groups || []).reduce((hash, group) => {
- hash[group.value] = group.count;
- return hash;
- }, {} as any);
+ const countMap = (dataset.groups || []).reduce((hash, group) => ({
+ ...hash,
+ [group.value]: group.count,
+ }), {} as any);
return {
label: dataset.label,
@@ -109,15 +109,18 @@ export class WorkPackageEmbeddedGraphComponent {
},
};
- const chartTypeDefaults:ChartOptions = { scales: {} };
- if (this.chartType === 'horizontalBar' || this.chartType === 'bar') {
- this.setChartAxesValues(chartTypeDefaults);
- }
+ const chartTypeDefaults:ChartOptions = (() => {
+ if (this.chartType === 'horizontalBar' || this.chartType === 'bar') {
+ return this.setChartAxesValues();
+ }
- this.chartOptions = {
+ return { scales: {} };
+ })();
+
+ this.internalChartOptions = {
...defaults,
...chartTypeDefaults,
- ...this.inputChartOptions,
+ ...this.chartOptions,
};
}
@@ -150,7 +153,8 @@ export class WorkPackageEmbeddedGraphComponent {
}
// function to set ticks of axis
- private setChartAxesValues(chartOptions:ChartOptions) {
+ private setChartAxesValues() {
+ const chartOptions:ChartOptions = { scales: {} };
const changeableValuesAxis = [{
stacked: true,
ticks: {
@@ -176,5 +180,7 @@ export class WorkPackageEmbeddedGraphComponent {
chartOptions.scales.yAxes = constantValuesAxis;
}
}
+
+ return chartOptions;
}
}
diff --git a/frontend/src/app/shared/components/work-package-graphs/embedded/wp-embedded-graph.html b/frontend/src/app/shared/components/work-package-graphs/embedded/wp-embedded-graph.html
index af07c0663b0..f95709075cf 100644
--- a/frontend/src/app/shared/components/work-package-graphs/embedded/wp-embedded-graph.html
+++ b/frontend/src/app/shared/components/work-package-graphs/embedded/wp-embedded-graph.html
@@ -3,7 +3,7 @@
[datasets]="chartData"
[labels]="chartLabels"
[chartType]="chartType"
- [options]="chartOptions"
+ [options]="internalChartOptions"
*ngIf="hasDataToDisplay">
</canvas>
<no-results *ngIf="!hasDataToDisplay && initialized"
diff --git a/frontend/src/app/shared/components/work-package-graphs/openproject-work-package-graphs.module.ts b/frontend/src/app/shared/components/work-package-graphs/openproject-work-package-graphs.module.ts
index f3e545d4746..7e7a748b7ae 100644
--- a/frontend/src/app/shared/components/work-package-graphs/openproject-work-package-graphs.module.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/openproject-work-package-graphs.module.ts
@@ -82,6 +82,8 @@ export class OpenprojectWorkPackageGraphsModule {
// so it will not be active. The current default of the plugin is to be enabled
// by default. This will be changed in the future:
// https://github.com/chartjs/chartjs-plugin-datalabels/issues/42
+ //
+ // eslint-ignore-next-line @typescript-eslint/no-unused-expressions
ChartDataLabels;
}
}
diff --git a/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.template.html b/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.template.html
index d4721a7cbc4..dba18a16c7c 100644
--- a/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.template.html
+++ b/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.template.html
@@ -10,14 +10,14 @@
</div>
</div>
-<wp-embedded-graph #wpEmbeddedGraphMulti
+<op-wp-embedded-graph #wpEmbeddedGraphMulti
[datasets]="datasets"
[chartOptions]="chartOptions"
*ngIf="displayMulti">
-</wp-embedded-graph>
+</op-wp-embedded-graph>
-<wp-embedded-graph #wpEmbeddedGraphSingle
+<op-wp-embedded-graph #wpEmbeddedGraphSingle
[datasets]="datasets"
[chartOptions]="chartOptions"
*ngIf="displaySingle">
-</wp-embedded-graph>
+</op-wp-embedded-graph>
diff --git a/frontend/src/app/shared/directives/a11y/double-click-or-tap.directive.ts b/frontend/src/app/shared/directives/a11y/double-click-or-tap.directive.ts
deleted file mode 100644
index 7bfd92b039a..00000000000
--- a/frontend/src/app/shared/directives/a11y/double-click-or-tap.directive.ts
+++ /dev/null
@@ -1,74 +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';
-
-@Directive({
- selector: '[doubleClickOrTap]',
-})
-export class DoubleClickOrTapDirective {
- @Input('doubleClickOrTapStopEvent') stopEventPropagation = true;
-
- @Output('doubleClickOrTap') eventHandler = new EventEmitter<any>();
-
- @HostListener('dblclick', ['$event'])
- @HostListener('tap', ['$event'])
- public handleClick(event:any):boolean {
- // Pass along double clicks immediately
- // Or when the hammer.js event tap count reaches two
- if (event.type === 'dblclick' || event.tapCount === 2) {
- this.eventHandler.emit(event);
- return this.eventStopReturnCode(event);
- }
-
- return true;
- }
-
- /**
- * If requested to stop event propagation, stop it
- * and return false.
- * Otherwise, return true.
- *
- * @param event Event being handled
- */
- private eventStopReturnCode(event:Event):boolean {
- if (this.stopEventPropagation) {
- event.preventDefault();
-
- if (event.stopPropagation) {
- event.stopPropagation();
- }
-
- return false;
- }
-
- return true;
- }
-}
diff --git a/frontend/src/app/shared/directives/a11y/keyboard-shortcut-service.ts b/frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
similarity index 99%
rename from frontend/src/app/shared/directives/a11y/keyboard-shortcut-service.ts
rename to frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
index e75fcaf48f8..5b9d10432b0 100644
--- a/frontend/src/app/shared/directives/a11y/keyboard-shortcut-service.ts
+++ b/frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
@@ -149,13 +149,11 @@ export class KeyboardShortcutService {
focusItemOffset(offset:number) {
const list = this.findListInPage();
- let index;
-
if (list === null) {
return;
}
- index = list.indexOf(
+ const index:number = list.indexOf(
jQuery(document.activeElement!)
.closest(accessibleRowSelector)
.find(':visible:tabbable')[0],
diff --git a/frontend/src/app/shared/directives/a11y/openproject-a11y.module.ts b/frontend/src/app/shared/directives/a11y/openproject-a11y.module.ts
deleted file mode 100644
index a8966f26f91..00000000000
--- a/frontend/src/app/shared/directives/a11y/openproject-a11y.module.ts
+++ /dev/null
@@ -1,47 +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.
-// ++ Ng1FieldControlsWrapper,
-
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { CommonModule } from '@angular/common';
-import { DoubleClickOrTapDirective } from 'core-app/shared/directives/a11y/double-click-or-tap.directive';
-
-@NgModule({
- imports: [
- FormsModule,
- CommonModule,
- ],
- exports: [
- DoubleClickOrTapDirective,
- ],
- declarations: [
- DoubleClickOrTapDirective,
- ],
-})
-export class OpenprojectAccessibilityModule {
-}
diff --git a/frontend/src/app/shared/directives/autofocus/autofocus.directive.ts b/frontend/src/app/shared/directives/autofocus/autofocus.directive.ts
deleted file mode 100644
index c98014ce7c9..00000000000
--- a/frontend/src/app/shared/directives/autofocus/autofocus.directive.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import {
- AfterContentInit, Directive, ElementRef, Input,
-} from '@angular/core';
-import { FocusHelperService } from 'core-app/shared/directives/focus/focus-helper';
-
-@Directive({
- selector: '[autoFocus]',
-})
-export class AutofocusDirective implements AfterContentInit {
- @Input('autoFocus-condition') public condition = true;
-
- public constructor(private el:ElementRef,
- private focusHelper:FocusHelperService) {
-
- }
-
- public ngAfterContentInit() {
- if (!this.condition) {
- return;
- }
-
- setTimeout(() => {
- this.focusHelper.focusElement(jQuery(this.el.nativeElement));
- }, 100);
- }
-}
diff --git a/frontend/src/app/shared/directives/focus/autofocus.directive.ts b/frontend/src/app/shared/directives/focus/autofocus.directive.ts
new file mode 100644
index 00000000000..b056a45b616
--- /dev/null
+++ b/frontend/src/app/shared/directives/focus/autofocus.directive.ts
@@ -0,0 +1,32 @@
+import {
+ AfterViewInit,
+ Directive,
+ ElementRef,
+ Input,
+} from '@angular/core';
+import { FocusHelperService } from './focus-helper';
+
+@Directive({
+ selector: '[opAutofocus]',
+})
+export class AutofocusDirective implements AfterViewInit {
+ @Input('opAutofocus') public condition = true;
+
+ @Input('opAutofocusPriority') priority?:number = 0;
+
+ constructor(
+ readonly FocusHelper:FocusHelperService,
+ readonly elementRef:ElementRef,
+ ) { }
+
+ ngAfterViewInit() {
+ this.updateFocus();
+ }
+
+ private updateFocus() {
+ if (this.condition) {
+ const element = jQuery(this.elementRef.nativeElement);
+ this.FocusHelper.focusElement(element, this.priority);
+ }
+ }
+}
diff --git a/frontend/src/app/shared/directives/focus/contain-helpers.ts b/frontend/src/app/shared/directives/focus/contain-helpers.ts
index 3fa68881a2c..06b93442b67 100644
--- a/frontend/src/app/shared/directives/focus/contain-helpers.ts
+++ b/frontend/src/app/shared/directives/focus/contain-helpers.ts
@@ -26,29 +26,26 @@
// See docs/COPYRIGHT.rdoc for more details.
//++
-export namespace ContainHelpers {
-
- /**
- * Execute the callback when the element is outside
- * @param {Element} within
- * @param {Function} callback
- */
- export function whenOutside(within:Element, callback:Function) {
- setTimeout(() => {
- if (!insideOrSelf(within, document.activeElement!)) {
- callback();
- }
- }, 20);
- }
+/**
+ * Return whether the target element is either the same as within, or contained within it.
+ *
+ * @param {Element} within
+ * @param {Element} target
+ * @returns {boolean}
+ */
+export function insideOrSelf(within:Element, target:Element):boolean {
+ return within === target || within.contains(target);
+}
- /**
- * Return whether the target element is either the same as within, or contained within it.
- *
- * @param {Element} within
- * @param {Element} target
- * @returns {boolean}
- */
- export function insideOrSelf(within:Element, target:Element):boolean {
- return within === target || within.contains(target);
- }
+/**
+ * Execute the callback when the element is outside
+ * @param {Element} within
+ * @param {Function} callback
+ */
+export function whenOutside(within:Element, callback:() => void) {
+ setTimeout(() => {
+ if (!insideOrSelf(within, document.activeElement!)) {
+ callback();
+ }
+ }, 20);
}
diff --git a/frontend/src/app/shared/directives/focus/focus-helper.ts b/frontend/src/app/shared/directives/focus/focus-helper.ts
index dcbb8d03b20..49ae0d34259 100644
--- a/frontend/src/app/shared/directives/focus/focus-helper.ts
+++ b/frontend/src/app/shared/directives/focus/focus-helper.ts
@@ -53,12 +53,13 @@ export class FocusHelperService {
if (checkTimeout) {
// new timeout window -> reset priority
this.lastPriority = -1;
- } else {
+ return checkTimeout;
+ }
+
+ if (priority > this.lastPriority) {
// within timeout window
- if (priority > this.lastPriority) {
- this.lastPriority = priority;
- return true;
- }
+ this.lastPriority = priority;
+ return true;
}
return checkTimeout;
diff --git a/frontend/src/app/shared/directives/focus/focus-within.directive.ts b/frontend/src/app/shared/directives/focus/focus-within.directive.ts
index 49a90520d8a..ad8a23db8e7 100644
--- a/frontend/src/app/shared/directives/focus/focus-within.directive.ts
+++ b/frontend/src/app/shared/directives/focus/focus-within.directive.ts
@@ -36,7 +36,7 @@ import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destr
// with courtesy of http://stackoverflow.com/a/29722694/3206935
@Directive({
- selector: '[focus-within]',
+ selector: '[opFocusWithin]',
})
export class FocusWithinDirective extends UntilDestroyedMixin implements OnInit {
@Input() public selector:string;
@@ -69,8 +69,8 @@ export class FocusWithinDirective extends UntilDestroyedMixin implements OnInit
element[0].addEventListener('blur', blurListener, true);
setTimeout(() => {
- element.addClass('focus-within--trigger');
- element.find(this.selector).addClass('focus-within--depending');
+ element.addClass('op-focus-within');
+ element.find(this.selector).addClass('op-focus-within');
}, 0);
}
}
diff --git a/frontend/src/app/shared/directives/focus/focus.directive.ts b/frontend/src/app/shared/directives/focus/focus.directive.ts
deleted file mode 100644
index 42739e00cad..00000000000
--- a/frontend/src/app/shared/directives/focus/focus.directive.ts
+++ /dev/null
@@ -1,56 +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 {
- AfterViewInit, Directive, ElementRef, Input,
-} from '@angular/core';
-import { FocusHelperService } from 'core-app/shared/directives/focus/focus-helper';
-
-@Directive({
- selector: '[focus]',
-})
-export class FocusDirective implements AfterViewInit {
- @Input('focus') condition:boolean;
-
- @Input('focusPriority') priority?:number = 0;
-
- constructor(readonly FocusHelper:FocusHelperService,
- readonly elementRef:ElementRef) {
- }
-
- ngAfterViewInit() {
- this.updateFocus();
- }
-
- private updateFocus() {
- if (this.condition) {
- const element = jQuery(this.elementRef.nativeElement);
- this.FocusHelper.focusElement(element, this.priority);
- }
- }
-}
diff --git a/frontend/src/app/shared/directives/focus/focus.module.ts b/frontend/src/app/shared/directives/focus/focus.module.ts
index 02c8a1d83c1..ff7060babe6 100644
--- a/frontend/src/app/shared/directives/focus/focus.module.ts
+++ b/frontend/src/app/shared/directives/focus/focus.module.ts
@@ -2,18 +2,18 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FocusWithinDirective } from './focus-within.directive';
-import { FocusDirective } from './focus.directive';
+import { AutofocusDirective } from './autofocus.directive';
@NgModule({
declarations: [
- FocusDirective,
+ AutofocusDirective,
FocusWithinDirective,
],
imports: [
CommonModule,
],
exports: [
- FocusDirective,
+ AutofocusDirective,
FocusWithinDirective,
],
})
diff --git a/frontend/src/app/shared/directives/highlight-col/highlight-col.directive.ts b/frontend/src/app/shared/directives/highlight-col/highlight-col.directive.ts
index 0203f177fdb..39b2b6d7b02 100644
--- a/frontend/src/app/shared/directives/highlight-col/highlight-col.directive.ts
+++ b/frontend/src/app/shared/directives/highlight-col/highlight-col.directive.ts
@@ -30,12 +30,13 @@ import {
Component, ElementRef, OnDestroy, OnInit,
} from '@angular/core';
+export const highlightColSelector = 'col[opHighlightCol]';
+
@Component({
- selector: 'col[highlight-col]',
+ selector: highlightColSelector,
template: '',
})
-
-export class HighlightColDirective implements OnInit, OnDestroy {
+export class OpHighlightColDirective implements OnInit, OnDestroy { // eslint-disable-line @angular-eslint/component-class-suffix
private $element:JQuery;
private thead:JQuery;
@@ -68,8 +69,3 @@ export class HighlightColDirective implements OnInit, OnDestroy {
this.thead.off('mouseenter mouseleave');
}
}
-
-export const highlightColBootstrap = {
- selector: 'col[highlight-col]',
- cls: HighlightColDirective,
-};
diff --git a/frontend/src/app/shared/helpers/angular/inject-field.decorator.ts b/frontend/src/app/shared/helpers/angular/inject-field.decorator.ts
index f7328d76db0..d1009fade92 100644
--- a/frontend/src/app/shared/helpers/angular/inject-field.decorator.ts
+++ b/frontend/src/app/shared/helpers/angular/inject-field.decorator.ts
@@ -8,6 +8,7 @@ export interface InjectableClass {
export function InjectField(token?:any, defaultValue:any = null, flags?:InjectFlags) {
return (target:InjectableClass, property:string) => {
+ // eslint-ignore-next-line no-param-reassign
if (delete (target as any)[property]) {
Object.defineProperty(target, property, {
get(this:InjectableClass) {
@@ -17,7 +18,7 @@ export function InjectField(token?:any, defaultValue:any = null, flags?:InjectFl
const type = Reflect.getMetadata('design:type', target, property);
return this.injector.get<any>(type, defaultValue, flags);
},
- set(this:InjectableClass, _val:any) {
+ set(this:InjectableClass) {
debugLog(`Trying to set InjectField property ${property}`);
},
});
diff --git a/frontend/src/app/shared/helpers/angular/tracking-functions.ts b/frontend/src/app/shared/helpers/angular/tracking-functions.ts
index cfcd491013e..7206f9e8646 100644
--- a/frontend/src/app/shared/helpers/angular/tracking-functions.ts
+++ b/frontend/src/app/shared/helpers/angular/tracking-functions.ts
@@ -1,57 +1,55 @@
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
-export namespace AngularTrackingHelpers {
- export function halHref<T extends HalResource>(_index:number, item:T):string|null {
- return item.href;
- }
-
- export function compareByName<T extends HalResource>(a:T|undefined|null, b:T|undefined|null):boolean {
- return compareByAttribute('name')(a, b);
- }
+export function halHref<T extends HalResource>(_index:number, item:T):string|null {
+ return item.href;
+}
- export function compareByAttribute(attribute:string) {
- return (a:any, b:any) => {
- const bothNil = !a && !b;
- return bothNil || (!!a && !!b && a[attribute] === b[attribute]);
- };
- }
+export function compareByAttribute(attribute:string) {
+ return (a:any, b:any) => {
+ const bothNil = !a && !b;
+ return bothNil || (!!a && !!b && a[attribute] === b[attribute]);
+ };
+}
- export function trackByName(i:number, item:any) {
- return _.get(item, 'name');
- }
+export function compareByName<T extends HalResource>(a:T|undefined|null, b:T|undefined|null):boolean {
+ return compareByAttribute('name')(a, b);
+}
- export function trackByHref(i:number, item:{ href?:unknown }) {
- return _.get(item, 'href');
- }
+export function trackByName(i:number, item:any) {
+ return _.get(item, 'name');
+}
- export function trackByProperty(prop:string) {
- return (i:number, item:unknown) => _.get(item, prop);
- }
+export function trackByHref(i:number, item:{ href?:unknown }) {
+ return _.get(item, 'href');
+}
- export function trackByHrefAndProperty(propertyName:string) {
- return (i:number, item:HalResource) => {
- const href = _.get(item, 'href');
- const prop = _.get(item, propertyName, 'none');
+export function trackByProperty(prop:string) {
+ return (i:number, item:unknown) => _.get(item, prop);
+}
- return `${href}#${propertyName}=${prop}`;
- };
- }
+export function trackByHrefAndProperty(propertyName:string) {
+ return (i:number, item:HalResource) => {
+ const href:string = _.get(item, 'href') || '';
+ const prop:string = _.get(item, propertyName, 'none');
- export function trackByTrackingIdentifier(i:number, item:any) {
- return _.get(item, 'trackingIdentifier', item && item.href);
- }
+ return `${href}#${propertyName}=${prop}`;
+ };
+}
- export function compareByHref<T extends HalResource>(a:T|undefined|null, b:T|undefined|null):boolean {
- const bothNil = !a && !b;
- return bothNil || (!!a && !!b && a.href === b.href);
- }
+export function trackByTrackingIdentifier(i:number, item:any) {
+ return _.get(item, 'trackingIdentifier', item && item.href);
+}
- export function compareByHrefOrString<T extends HalResource>(a:T|string|undefined|null, b:T|string|undefined|null):boolean {
- if (a instanceof HalResource && b instanceof HalResource) {
- return compareByHref(a as HalResource, b as HalResource);
- }
+export function compareByHref<T extends HalResource>(a:T|undefined|null, b:T|undefined|null):boolean {
+ const bothNil = !a && !b;
+ return bothNil || (!!a && !!b && a.href === b.href);
+}
- const bothNil = !a && !b;
- return bothNil || a === b;
+export function compareByHrefOrString<T extends HalResource>(a:T|string|undefined|null, b:T|string|undefined|null):boolean {
+ if (a instanceof HalResource && b instanceof HalResource) {
+ return compareByHref(a as HalResource, b as HalResource);
}
+
+ const bothNil = !a && !b;
+ return bothNil || a === b;
}
diff --git a/frontend/src/app/shared/helpers/api-v3/api-v3-filter-builder.ts b/frontend/src/app/shared/helpers/api-v3/api-v3-filter-builder.ts
index 536910e60c3..cf2bdfe0987 100644
--- a/frontend/src/app/shared/helpers/api-v3/api-v3-filter-builder.ts
+++ b/frontend/src/app/shared/helpers/api-v3/api-v3-filter-builder.ts
@@ -46,14 +46,18 @@ export type ApiV3FilterObject = { [filter:string]:ApiV3FilterValue };
export class ApiV3FilterBuilder {
private filterMap:ApiV3FilterObject = {};
- public add(name:string, operator:FilterOperator, values:ApiV3FilterValueType[]|boolean):this {
- if (values === true) {
- values = TrueValue;
- }
+ public add(name:string, operator:FilterOperator, filterValues:ApiV3FilterValueType[]|boolean):this {
+ const values = (() => {
+ if (filterValues === true) {
+ return TrueValue;
+ }
- if (values === false) {
- values = FalseValue;
- }
+ if (filterValues === false) {
+ return FalseValue;
+ }
+
+ return filterValues;
+ })();
this.filterMap[name] = {
operator,
@@ -143,23 +147,18 @@ export class ApiV3FilterBuilder {
}
private serializeFilter(filter:ApiV3Filter) {
- let transformedFilter:string;
- let keys:Array<string>;
-
- keys = Object.keys(filter);
+ const keys:Array<string> = Object.keys(filter);
const typeName = keys[0];
const operatorAndValues = filter[typeName];
- transformedFilter = `{"${typeName}":{"operator":"${operatorAndValues.operator}","values":[${operatorAndValues.values
+ return `{"${typeName}":{"operator":"${operatorAndValues.operator}","values":[${operatorAndValues.values
.map((val) => this.serializeFilterValue(val))
.join(',')}]}}`;
-
- return transformedFilter;
}
private serializeFilterValue(filterValue:ApiV3FilterValueType) {
- return `"${filterValue}"`;
+ return `"${filterValue.toString()}"`;
}
}
diff --git a/frontend/src/app/shared/helpers/debug_output.ts b/frontend/src/app/shared/helpers/debug_output.ts
index a1b352089c0..9d5c20ec939 100644
--- a/frontend/src/app/shared/helpers/debug_output.ts
+++ b/frontend/src/app/shared/helpers/debug_output.ts
@@ -15,6 +15,7 @@ export function whenDebugging(cb:() => void) {
* through webpack.
*/
export function debugLog(message:string, ...args:any[]) {
+ // eslint-disable-next-line no-console
whenDebugging(() => console.log(`[DEBUG] ${message}`, ...args));
}
@@ -25,6 +26,7 @@ export function timeOutput(msg:string, cb:() => void):any {
const results = cb();
const t1 = performance.now();
+ // eslint-disable-next-line no-console
console.log(`%c${msg} completed in ${(t1 - t0)} milliseconds.`, 'color:#00A093;');
return results;
@@ -38,6 +40,7 @@ export function asyncTimeOutput(msg:string, promise:Promise<any>):any {
return promise.then(() => {
const t1 = performance.now();
+ // eslint-disable-next-line no-console
console.log(`%c${msg} completed in ${(t1 - t0)} milliseconds.`, 'color:#00A093;');
});
}
diff --git a/frontend/src/app/shared/helpers/dom/set-window-cursor.helper.ts b/frontend/src/app/shared/helpers/dom/set-window-cursor.helper.ts
index 49bec49ed1a..bb7484872ce 100644
--- a/frontend/src/app/shared/helpers/dom/set-window-cursor.helper.ts
+++ b/frontend/src/app/shared/helpers/dom/set-window-cursor.helper.ts
@@ -1,5 +1,3 @@
-export namespace DomHelpers {
- export function setBodyCursor(cursor:string, priority:'important'|'' = '') {
- document.body.style.setProperty('cursor', cursor, priority);
- }
+export function setBodyCursor(cursor:string, priority:'important'|'' = '') {
+ document.body.style.setProperty('cursor', cursor, priority);
}
diff --git a/frontend/src/app/shared/helpers/drag-and-drop/dom-autoscroll.service.ts b/frontend/src/app/shared/helpers/drag-and-drop/dom-autoscroll.service.ts
index 81ce36f42c7..30a30ca318d 100644
--- a/frontend/src/app/shared/helpers/drag-and-drop/dom-autoscroll.service.ts
+++ b/frontend/src/app/shared/helpers/drag-and-drop/dom-autoscroll.service.ts
@@ -48,7 +48,7 @@ export class DomAutoscrollService {
this.onMove(evt);
}
});
- jQuery(window).on('mousedown.domautoscroll touchstart.domautoscroll', () => this.down = true);
+ jQuery(window).on('mousedown.domautoscroll touchstart.domautoscroll', () => { this.down = true; });
jQuery(window).on('mouseup.domautoscroll touchend.domautoscroll', () => this.onUp());
jQuery(window).on('scroll.domautoscroll', (evt:any) => this.setScroll(evt));
}
@@ -86,7 +86,7 @@ export class DomAutoscrollService {
}
if (this.scrolling) {
- requestAnimationFrame(() => this.scrolling = false);
+ requestAnimationFrame(() => { this.scrolling = false; });
}
}
@@ -100,19 +100,11 @@ export class DomAutoscrollService {
return [];
}
- const results = [];
- if (this.elements.includes(target)) {
- results.push(target);
- }
-
- let targetObject = target;
- while (targetObject = targetObject.parentNode as HTMLElement) {
- if (this.elements.includes(targetObject)) {
- results.push(targetObject);
- }
- }
-
- return results;
+ const recurseParents = (targetObject:HTMLElement):HTMLElement[] => [
+ ...(this.elements.includes(targetObject) ? [targetObject] : []),
+ ...(targetObject.parentElement ? recurseParents(targetObject.parentElement) : []),
+ ];
+ return recurseParents(target);
}
public getElementsUnderPoint():HTMLElement[] {
@@ -184,24 +176,23 @@ export class DomAutoscrollService {
public scrollAutomatically(el:Element) {
const rect = getRect(el);
- let scrollx:number;
- let scrolly:number;
-
- if (this.point.x < rect.left + this.margin) {
- scrollx = -this.maxSpeed;
- } else if (this.point.x > rect.right - this.margin) {
- scrollx = this.maxSpeed;
- } else {
- scrollx = 0;
- }
-
- if (this.point.y < rect.top + this.margin) {
- scrolly = -this.maxSpeed;
- } else if (this.point.y > rect.bottom - this.margin) {
- scrolly = this.maxSpeed;
- } else {
- scrolly = 0;
- }
+ const scrollx = (() => {
+ if (this.point.x < rect.left + this.margin) {
+ return -this.maxSpeed;
+ } if (this.point.x > rect.right - this.margin) {
+ return this.maxSpeed;
+ }
+ return 0;
+ })();
+
+ const scrolly = (() => {
+ if (this.point.y < rect.top + this.margin) {
+ return -this.maxSpeed;
+ } if (this.point.y > rect.bottom - this.margin) {
+ return this.maxSpeed;
+ }
+ return 0;
+ })();
setTimeout(() => {
if (scrolly) {
@@ -214,19 +205,21 @@ export class DomAutoscrollService {
});
}
- public scrollY(el:any, amount:number) {
+ public scrollY(el:Element|Window, amount:number) {
if (el === window) {
window.scrollTo(el.pageXOffset, el.pageYOffset + amount);
} else {
- el.scrollTop += amount;
+ // eslint-disable-next-line no-param-reassign
+ (el as Element).scrollTop += amount;
}
}
- public scrollX(el:any, amount:number) {
+ public scrollX(el:Element|Window, amount:number) {
if (el === window) {
window.scrollTo(el.pageXOffset + amount, el.pageYOffset);
} else {
- el.scrollLeft += amount;
+ // eslint-disable-next-line no-param-reassign
+ (el as Element).scrollLeft += amount;
}
}
diff --git a/frontend/src/app/shared/helpers/drag-and-drop/drag-and-drop.helpers.ts b/frontend/src/app/shared/helpers/drag-and-drop/drag-and-drop.helpers.ts
index 9510a04a1e7..098696507ab 100644
--- a/frontend/src/app/shared/helpers/drag-and-drop/drag-and-drop.helpers.ts
+++ b/frontend/src/app/shared/helpers/drag-and-drop/drag-and-drop.helpers.ts
@@ -1,30 +1,29 @@
-export namespace DragAndDropHelpers {
- export function findIndex(el:HTMLElement):number {
- if (!el.parentElement) {
- return -1;
- }
-
- const children = Array.from(el.parentElement.children);
- return children.indexOf(el);
+export function findIndex(el:HTMLElement):number {
+ if (!el.parentElement) {
+ return -1;
}
- export function reinsert(el:HTMLElement, previousIndex:number|string, container:HTMLElement) {
- previousIndex = typeof previousIndex === 'string' ? parseInt(previousIndex, 10) : previousIndex;
- const currentIndex = el.parentNode && Array.from(el.parentNode.children).indexOf(el) || null;
- const children = Array.from(container.children);
- let pointOfInsertion;
+ const children = Array.from(el.parentElement.children);
+ return children.indexOf(el);
+}
+
+export function reinsert(el:HTMLElement, previousIndex:number|string, container:HTMLElement) {
+ const prev = typeof previousIndex === 'string' ? parseInt(previousIndex, 10) : previousIndex;
+ const currentIndex = el.parentNode ? Array.from(el.parentNode.children).indexOf(el) : null;
+ const children = Array.from(container.children);
- if (currentIndex != null) {
- const isDraggingDown = currentIndex > previousIndex;
- pointOfInsertion = isDraggingDown ? children[previousIndex] : children[previousIndex + 1];
- } else {
- pointOfInsertion = children[previousIndex];
+ const pointOfInsertion = (() => {
+ if (currentIndex != null && currentIndex >= 0) {
+ const isDraggingDown = currentIndex > prev;
+ return isDraggingDown ? children[prev] : children[prev + 1];
}
- if (pointOfInsertion) {
- container.insertBefore(el, pointOfInsertion);
- } else {
- container.appendChild(el);
- }
+ return children[prev];
+ })();
+
+ if (pointOfInsertion) {
+ container.insertBefore(el, pointOfInsertion);
+ } else {
+ container.appendChild(el);
}
}
diff --git a/frontend/src/app/shared/helpers/drag-and-drop/drag-and-drop.service.ts b/frontend/src/app/shared/helpers/drag-and-drop/drag-and-drop.service.ts
index a0cd064cbe6..5b0de00f25e 100644
--- a/frontend/src/app/shared/helpers/drag-and-drop/drag-and-drop.service.ts
+++ b/frontend/src/app/shared/helpers/drag-and-drop/drag-and-drop.service.ts
@@ -3,7 +3,7 @@ import {
} from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { DomAutoscrollService } from 'core-app/shared/helpers/drag-and-drop/dom-autoscroll.service';
-import { DragAndDropHelpers } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.helpers';
+import { findIndex, reinsert } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.helpers';
export interface DragMember {
dragContainer:HTMLElement;
@@ -51,8 +51,14 @@ export class DragAndDropService implements OnDestroy {
ngOnDestroy():void {
this.document.documentElement.removeEventListener('keydown', this.escapeListener);
- this.autoscroll && this.autoscroll.destroy();
- this.drake && this.drake.destroy();
+
+ if (this.autoscroll) {
+ this.autoscroll.destroy();
+ }
+
+ if (this.drake) {
+ this.drake.destroy();
+ }
}
public remove(container:HTMLElement) {
@@ -137,18 +143,19 @@ export class DragAndDropService implements OnDestroy {
ignoreInputTextSelection: true, // allows users to select input text, see details below
});
- this.drake.on('drag', (el:HTMLElement, source:HTMLElement) => {
- el.dataset.sourceIndex = DragAndDropHelpers.findIndex(el).toString();
+ this.drake.on('drag', (el:HTMLElement) => {
+ // eslint-disable-next-line no-param-reassign
+ el.dataset.sourceIndex = findIndex(el).toString();
});
- this.drake.on('over', (el:HTMLElement, container:HTMLElement) => {
+ this.drake.on('over', (_, container:HTMLElement) => {
const zone = container.closest('.drop-zone');
if (zone) {
zone.classList.add('-dragged-over');
}
});
- this.drake.on('out', (el:HTMLElement, container:HTMLElement) => {
+ this.drake.on('out', (_, container:HTMLElement) => {
const zone = container.closest('.drop-zone');
if (zone) {
zone.classList.remove('-dragged-over');
@@ -162,9 +169,9 @@ export class DragAndDropService implements OnDestroy {
}
});
- this.drake.on('drop', async (el:HTMLElement, target:HTMLElement, source:HTMLElement, sibling:HTMLElement) => {
+ this.drake.on('drop', (el:HTMLElement, target:HTMLElement, source:HTMLElement, sibling:HTMLElement) => {
try {
- await this.handleDrop(el, target, source, sibling);
+ void this.handleDrop(el, target, source, sibling);
} catch (e) {
console.error('Failed to handle drop of %O, %O', el, e);
}
@@ -177,7 +184,7 @@ export class DragAndDropService implements OnDestroy {
}
});
- this.drake.on('cancel', (el:HTMLElement, container:HTMLElement, source:HTMLElement) => {
+ this.drake.on('cancel', (el:HTMLElement, container:HTMLElement) => {
const member = this.member(container);
if (member && member.onCancel) {
member.onCancel(el);
@@ -194,16 +201,16 @@ export class DragAndDropService implements OnDestroy {
}
if (to === from) {
- return to.onMoved(el, target, source, sibling);
+ to.onMoved(el, target, source, sibling);
+ return;
}
const result = await to.onAdded(el, target, source, sibling);
-
if (result) {
from.onRemoved(el, target, source, sibling);
} else {
// Restore element in from container
- DragAndDropHelpers.reinsert(el, el.dataset.sourceIndex || -1, source);
+ reinsert(el, el.dataset.sourceIndex || -1, source);
}
}
}
diff --git a/frontend/src/app/shared/helpers/drag-and-drop/reorder-delta-builder.spec.ts b/frontend/src/app/shared/helpers/drag-and-drop/reorder-delta-builder.spec.ts
index c682e76d778..f861d8a23f7 100644
--- a/frontend/src/app/shared/helpers/drag-and-drop/reorder-delta-builder.spec.ts
+++ b/frontend/src/app/shared/helpers/drag-and-drop/reorder-delta-builder.spec.ts
@@ -228,7 +228,11 @@ describe('ReorderDeltaBuilder', () => {
});
it('just shifts two values when index <- 1 -> fromIndex', () => {
- const positions = { 1: 8192, 2: 0, 3: 16384 };
+ const positions = {
+ 1: 8192,
+ 2: 0,
+ 3: 16384,
+ };
// From index 1 to 0
const delta = buildSpecDelta('1', positions, ['1', '2', '3'], 1);
diff --git a/frontend/src/app/shared/helpers/drag-and-drop/reorder-delta-builder.ts b/frontend/src/app/shared/helpers/drag-and-drop/reorder-delta-builder.ts
index 006a0a04053..29218aa5e75 100644
--- a/frontend/src/app/shared/helpers/drag-and-drop/reorder-delta-builder.ts
+++ b/frontend/src/app/shared/helpers/drag-and-drop/reorder-delta-builder.ts
@@ -74,80 +74,37 @@ function isAscendingOrder(
}
/**
- * Insert +wpId+ at +index+ in a position that is determined either
- * by its neighbors, one of them in case both do not yet have a position
+ * Since from and to index or only one apart,
+ * we can swap the positions.
+ *
+ * TODO: This should not modify in-place and then return an unrelated value
*/
-function buildInsertPosition(
+function positionSwap(
+ delta:QueryOrder,
order:string[],
positions:QueryOrder,
- wpId:string,
index:number,
fromIndex:number|null,
-) {
- const delta:QueryOrder = {};
-
- // Special case, order is empty or only contains wpId
- // Then simply insert as the default position unless it already has a position
- if (order.length <= 1 && positions[wpId] === undefined) {
- return {
- ...delta,
- [wpId]: DEFAULT_ORDER,
- };
- }
-
- // Special case, shifted movement by one
- if (fromIndex !== null
- && Math.abs(fromIndex - index) === 1
- && positionSwap(delta, order, positions, index, fromIndex, wpId)
- ) {
+ wpId:string,
+):QueryOrder {
+ if (fromIndex === null) {
return delta;
}
- // Special case, index is 0
- if (index === 0) {
- return insertAsFirst(delta, order, positions, index, wpId);
- }
-
- // Ensure previous positions exist so we can insert wpId @ index
- const predecessorPosition = buildUpPredecessorPosition(delta, order, positions, index);
-
- // Ensure we reorder when predecessor is at max already
- if (predecessorPosition >= MAX_ORDER) {
- debugLog('Predecessor position is at max order, need to reorder');
- return reorderedInsert(delta, order, positions);
- }
-
- // Get the actual successor position, it might vary wildly from the optimal position
- const successorPosition = positionFor(delta, order, positions, index + 1);
-
- if (successorPosition === undefined) {
- // Successor does not have a position yet (is NULL), any position will work
- // so let's use the optimal one which is halfway to a potential successor
- return {
- ...delta,
- [wpId]: predecessorPosition + (ORDER_DISTANCE / 2),
- };
- }
-
- // Ensure we reorder when successor is at max already
- if (successorPosition >= MAX_ORDER) {
- debugLog('Successor position is at max order, need to reorder');
- return reorderedInsert(delta, order, positions);
- }
-
- // successor exists and has a position
- // We will want to insert at the half way from predecessorPosition ... successorPosition
- const distance = Math.floor((successorPosition - predecessorPosition) / 2);
+ const myPosition = positionFor(delta, order, positions, index);
+ const neighbor = order[fromIndex];
+ const neighborPosition = positionFor(delta, order, positions, fromIndex);
- // If there is no space to insert, we're going to optimize the available space
- if (distance < 1) {
- debugLog('Cannot insert at optimal position, no space left. Need to reorder');
- return reorderedInsert(delta, order, positions);
+ // If either the neighbor or wpid have no position yet,
+ // go through the regular update flow
+ if (myPosition === undefined || neighborPosition === undefined) {
+ return delta;
}
return {
...delta,
- [wpId]: predecessorPosition + distance,
+ [`${wpId}`]: neighborPosition,
+ [`${neighbor}`]: myPosition,
};
}
@@ -177,37 +134,6 @@ function insertAsFirst(
};
}
-/**
- * Since from and to index or only one apart,
- * we can swap the positions.
- *
- * TODO: This should not modify in-place and then return an unrelated value
- */
-function positionSwap(
- delta:QueryOrder,
- order:string[],
- positions:QueryOrder,
- index:number,
- fromIndex:number,
- wpId:string,
-):boolean {
- const myPosition = positionFor(delta, order, positions, index);
- const neighbor = order[fromIndex];
- const neighborPosition = positionFor(delta, order, positions, fromIndex);
-
- // If either the neighbor or wpid have no position yet,
- // go through the regular update flow
- if (myPosition === undefined || neighborPosition === undefined) {
- return false;
- }
-
- // Simply swap the two positions
- delta[wpId] = neighborPosition;
- delta[neighbor] = myPosition;
-
- return true;
-}
-
/**
* Builds any previous unset position from 0 .. index
* so we can properly insert the wpId @ index.
@@ -219,20 +145,58 @@ function buildUpPredecessorPosition(
index:number,
) {
let predecessorPosition:number = DEFAULT_ORDER - ORDER_DISTANCE;
-
+ const newDelta = { ...delta };
for (let i = 0; i < index; i += 1) {
const id = order[i];
const position = positions[id];
// If this current ID has no position yet, assign the current one
if (position === undefined) {
- predecessorPosition = delta[id] = predecessorPosition + ORDER_DISTANCE;
+ newDelta[id] = predecessorPosition + ORDER_DISTANCE;
+ predecessorPosition = newDelta[id];
} else {
predecessorPosition = position;
}
}
- return predecessorPosition;
+ return {
+ predecessorPosition,
+ delta: newDelta,
+ };
+}
+
+/**
+ * Returns the minimal position assigned currently
+ */
+function firstPosition(
+ delta:QueryOrder,
+ order:string[],
+ positions:QueryOrder,
+):number {
+ const wpId = order[0] || '';
+ return livePosition(delta, positions, wpId) || 0;
+}
+
+/**
+ * Returns the maximum position assigned currently.
+ * Note that a list can be unpositioned at the beginning, so this may return undefined
+ */
+function lastPosition(
+ delta:QueryOrder,
+ order:string[],
+ positions:QueryOrder,
+):number {
+ for (let i = order.length - 1; i >= 0; i -= 1) {
+ const wpId = order[i];
+ const position = livePosition(delta, positions, wpId);
+
+ // Return the first set position.
+ if (position !== undefined) {
+ return position;
+ }
+ }
+
+ return 0;
}
/**
@@ -241,11 +205,14 @@ function buildUpPredecessorPosition(
function redistribute(
delta:QueryOrder,
order:string[],
- min:number,
- max:number,
+ minIndex:number,
+ maxIndex:number,
) {
const itemsToDistribute = order.length;
+ let min = minIndex;
+ let max = maxIndex;
+
// We can keep min and max orders if distance/(items to distribute) >= 1
let space = Math.floor((max - min) / (itemsToDistribute - 1));
@@ -266,12 +233,108 @@ function redistribute(
}
// Assign positions for all values in between min/max
+ const newDelta = { ...delta };
for (let i = 0; i < itemsToDistribute; i += 1) {
const wpId = order[i];
- delta[wpId] = min + (i * space);
+ newDelta[wpId] = min + (i * space);
}
- return delta;
+ return newDelta;
+}
+
+/**
+ * There was no space left at the desired insert position,
+ * we're going to evenly distribute all items again
+ */
+function reorderedInsert(
+ delta:QueryOrder,
+ order:string[],
+ positions:QueryOrder,
+) {
+ // Get the current distance between orders
+ // Both must be set by now due to +buildUpPredecessorPosition+ having run.
+ const min = firstPosition(delta, order, positions);
+ const max = lastPosition(delta, order, positions);
+
+ return redistribute(delta, order, min, max);
+}
+
+/**
+ * Insert +wpId+ at +index+ in a position that is determined either
+ * by its neighbors, one of them in case both do not yet have a position
+ */
+function buildInsertPosition(
+ order:string[],
+ positions:QueryOrder,
+ wpId:string,
+ index:number,
+ fromIndex:number|null,
+):QueryOrder {
+ const delta = {};
+ // Special case, order is empty or only contains wpId
+ // Then simply insert as the default position unless it already has a position
+ if (order.length <= 1 && positions[wpId] === undefined) {
+ return {
+ ...delta,
+ [wpId]: DEFAULT_ORDER,
+ };
+ }
+
+ // Special case, shifted movement by one
+ const newDelta = positionSwap(delta, order, positions, index, fromIndex, wpId);
+ if (fromIndex !== null
+ && Math.abs(fromIndex - index) === 1
+ && delta !== newDelta
+ ) {
+ return newDelta;
+ }
+
+ // Special case, index is 0
+ if (index === 0) {
+ return insertAsFirst(newDelta, order, positions, index, wpId);
+ }
+
+ // Ensure previous positions exist so we can insert wpId @ index
+ const { delta: rebuiltDelta, predecessorPosition } = buildUpPredecessorPosition(newDelta, order, positions, index);
+
+ // Ensure we reorder when predecessor is at max already
+ if (predecessorPosition >= MAX_ORDER) {
+ debugLog('Predecessor position is at max order, need to reorder');
+ return reorderedInsert(rebuiltDelta, order, positions);
+ }
+
+ // Get the actual successor position, it might vary wildly from the optimal position
+ const successorPosition = positionFor(rebuiltDelta, order, positions, index + 1);
+
+ if (successorPosition === undefined) {
+ // Successor does not have a position yet (is NULL), any position will work
+ // so let's use the optimal one which is halfway to a potential successor
+ return {
+ ...rebuiltDelta,
+ [wpId]: predecessorPosition + (ORDER_DISTANCE / 2),
+ };
+ }
+
+ // Ensure we reorder when successor is at max already
+ if (successorPosition >= MAX_ORDER) {
+ debugLog('Successor position is at max order, need to reorder');
+ return reorderedInsert(rebuiltDelta, order, positions);
+ }
+
+ // successor exists and has a position
+ // We will want to insert at the half way from predecessorPosition ... successorPosition
+ const distance = Math.floor((successorPosition - predecessorPosition) / 2);
+
+ // If there is no space to insert, we're going to optimize the available space
+ if (distance < 1) {
+ debugLog('Cannot insert at optimal position, no space left. Need to reorder');
+ return reorderedInsert(rebuiltDelta, order, positions);
+ }
+
+ return {
+ ...rebuiltDelta,
+ [wpId]: predecessorPosition + distance,
+ };
}
/**
@@ -309,57 +372,6 @@ function minMaxPositions(
return [DEFAULT_ORDER, order.length * ORDER_DISTANCE];
}
-/**
- * Returns the minimal position assigned currently
- */
-function firstPosition(
- delta:QueryOrder,
- order:string[],
- positions:QueryOrder,
-):number {
- const wpId = order[0] || '';
- return livePosition(delta, positions, wpId) || 0;
-}
-
-/**
- * Returns the maximum position assigned currently.
- * Note that a list can be unpositioned at the beginning, so this may return undefined
- */
-function lastPosition(
- delta:QueryOrder,
- order:string[],
- positions:QueryOrder,
-):number {
- for (let i = order.length - 1; i >= 0; i -= 1) {
- const wpId = order[i];
- const position = livePosition(delta, positions, wpId);
-
- // Return the first set position.
- if (position !== undefined) {
- return position;
- }
- }
-
- return 0;
-}
-
-/**
- * There was no space left at the desired insert position,
- * we're going to evenly distribute all items again
- */
-function reorderedInsert(
- delta:QueryOrder,
- order:string[],
- positions:QueryOrder,
-) {
- // Get the current distance between orders
- // Both must be set by now due to +buildUpPredecessorPosition+ having run.
- const min = firstPosition(delta, order, positions);
- const max = lastPosition(delta, order, positions);
-
- return redistribute(delta, order, min, max);
-}
-
/**
* Reassign mixed positions so that they are strictly ascending again,
* but try to keep relative positions alive
diff --git a/frontend/src/app/shared/helpers/i18n/localized-link.ts b/frontend/src/app/shared/helpers/i18n/localized-link.ts
index 1e5aabb88d1..b5f9639b72d 100644
--- a/frontend/src/app/shared/helpers/i18n/localized-link.ts
+++ b/frontend/src/app/shared/helpers/i18n/localized-link.ts
@@ -1,19 +1,16 @@
-export namespace I18nHelpers {
+export interface LocalizedLinkMap {
+ [key:string]:string;
- export interface LocalizedLinkMap {
- [key:string]:string;
-
- en:string;
- }
+ en:string;
+}
- /**
- * Return the matching link for the current locale
- *
- * @param map A hash of locale => URL to use
- */
- export function localizeLink(map:LocalizedLinkMap) {
- const { locale } = I18n;
+/**
+ * Return the matching link for the current locale
+ *
+ * @param map A hash of locale => URL to use
+ */
+export function localizeLink(map:LocalizedLinkMap) {
+ const { locale } = I18n;
- return map[locale] || map.en;
- }
+ return map[locale] || map.en;
}
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 2b1d3f09adc..86da3fc8391 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -35,7 +35,6 @@ import { NgOptionHighlightModule } from '@ng-select/ng-option-highlight';
import { DragulaModule } from 'ng2-dragula';
import { DynamicModule } from 'ng-dynamic-component';
import { StateService, UIRouterModule } from '@uirouter/angular';
-import { OpenprojectAccessibilityModule } from 'core-app/shared/directives/a11y/openproject-a11y.module';
import { CurrentUserModule } from 'core-app/core/current-user/current-user.module';
import { IconModule } from 'core-app/shared/components/icon/icon.module';
import { AttributeHelpTextModule } from 'core-app/shared/components/attribute-help-texts/attribute-help-text.module';
@@ -52,7 +51,7 @@ import { EnterpriseBannerBootstrapComponent } from 'core-app/shared/components/e
import { HomescreenNewFeaturesBlockComponent } from 'core-app/features/homescreen/blocks/new-features.component';
import { TablePaginationComponent } from 'core-app/shared/components/table-pagination/table-pagination.component';
import { HookService } from 'core-app/features/plugins/hook-service';
-import { highlightColBootstrap, HighlightColDirective } from './directives/highlight-col/highlight-col.directive';
+import { highlightColSelector, OpHighlightColDirective } from './directives/highlight-col/highlight-col.directive';
import { CopyToClipboardDirective } from './components/copy-to-clipboard/copy-to-clipboard.directive';
import { OpDateTimeComponent } from './components/date/op-date-time.component';
@@ -67,7 +66,6 @@ import { PersistentToggleComponent } from './components/persistent-toggle/persis
import { AddSectionDropdownComponent } from './components/hide-section/add-section-dropdown/add-section-dropdown.component';
import { HideSectionLinkComponent } from './components/hide-section/hide-section-link/hide-section-link.component';
import { RemoteFieldUpdaterComponent } from './components/remote-field-updater/remote-field-updater.component';
-import { AutofocusDirective } from './directives/autofocus/autofocus.directive';
import { ShowSectionDropdownComponent } from './components/hide-section/show-section-dropdown.component';
import { SlideToggleComponent } from './components/slide-toggle/slide-toggle.component';
import { DynamicBootstrapModule } from './components/dynamic-bootstrap/dynamic-bootstrap.module';
@@ -90,7 +88,10 @@ export function bootstrapModule(injector:Injector) {
const hookService = injector.get(HookService);
hookService.register('openProjectAngularBootstrap', () => [
- highlightColBootstrap,
+ {
+ selector: highlightColSelector,
+ cls: OpHighlightColDirective,
+ },
]);
}
@@ -106,8 +107,6 @@ export function bootstrapModule(injector:Injector) {
PortalModule,
DragDropModule,
DragulaModule,
- // Our own A11y module
- OpenprojectAccessibilityModule,
CurrentUserModule,
NgSelectModule,
NgOptionHighlightModule,
@@ -130,7 +129,6 @@ export function bootstrapModule(injector:Injector) {
DragDropModule,
IconModule,
AttributeHelpTextModule,
- OpenprojectAccessibilityModule,
NgSelectModule,
NgOptionHighlightModule,
DynamicBootstrapModule,
@@ -139,7 +137,6 @@ export function bootstrapModule(injector:Injector) {
DatePickerModule,
FocusModule,
OpDateTimeComponent,
- AutofocusDirective,
// Notifications
NotificationsContainerComponent,
@@ -148,7 +145,7 @@ export function bootstrapModule(injector:Injector) {
OpDateTimeComponent,
// Table highlight
- HighlightColDirective,
+ OpHighlightColDirective,
ResizerComponent,
@@ -180,7 +177,6 @@ export function bootstrapModule(injector:Injector) {
],
declarations: [
OpDateTimeComponent,
- AutofocusDirective,
// Notifications
NotificationsContainerComponent,
@@ -192,7 +188,7 @@ export function bootstrapModule(injector:Injector) {
IconTriggeredContextMenuComponent,
// Table highlight
- HighlightColDirective,
+ OpHighlightColDirective,
// Add functionality to rails rendered templates
CopyToClipboardDirective,
diff --git a/frontend/src/global_styles/content/_focus_within.sass b/frontend/src/global_styles/content/_focus_within.sass
index 1438769b2ad..e8052417d27 100644
--- a/frontend/src/global_styles/content/_focus_within.sass
+++ b/frontend/src/global_styles/content/_focus_within.sass
@@ -26,16 +26,15 @@
// See docs/COPYRIGHT.rdoc for more details.
//++
-
-.focus-within--trigger
+.op-focus-within
&:hover,
&:focus,
&.-focus
- .focus-within--depending
+ .op-focus-within--depending
visibility: visible
-.focus-within--depending
- visibility: hidden
+ &--depending
+ visibility: hidden
&.-visible
visibility: visible
diff --git a/frontend/src/global_styles/content/_table.lsg b/frontend/src/global_styles/content/_table.lsg
index ac6459489db..9c59f3615f1 100644
--- a/frontend/src/global_styles/content/_table.lsg
+++ b/frontend/src/global_styles/content/_table.lsg
@@ -8,11 +8,11 @@
<div class="generic-table--results-container" style="max-height: 340px;">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
@@ -116,11 +116,11 @@ Use `-no-ellipse` class to a TD element to disable the text-overflow applied usu
<div class="generic-table--results-container" style="max-height: 340px;">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
@@ -198,11 +198,11 @@ Use `-no-ellipse` class to a TD element to disable the text-overflow applied usu
<div class="generic-table--results-container" style="max-height: 340px;">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/frontend/src/global_styles/content/work_packages/_table_content.lsg b/frontend/src/global_styles/content/work_packages/_table_content.lsg
index 6c4310b196c..77e94655024 100644
--- a/frontend/src/global_styles/content/work_packages/_table_content.lsg
+++ b/frontend/src/global_styles/content/work_packages/_table_content.lsg
@@ -7,11 +7,11 @@
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 90e32bcaa32..9e083cbba70 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -38,11 +38,11 @@ whenDebugging(() => {
});
// Import the correct locale early on
-initializeLocale()
+void initializeLocale()
.then(() => {
jQuery(() => {
// Due to the behaviour of the Edge browser we need to wait for 'DOM ready'
- platformBrowserDynamic()
+ void platformBrowserDynamic()
.bootstrapModule(OpenProjectModule)
.then(() => {
jQuery('body').addClass('__ng2-bootstrap-has-run');
diff --git a/frontend/src/typings.d.ts b/frontend/src/typings.d.ts
index b1dd6f60676..fd4d1283890 100644
--- a/frontend/src/typings.d.ts
+++ b/frontend/src/typings.d.ts
@@ -6,7 +6,7 @@
declare let module:NodeModule;
declare module 'dom-plane' {
export function createPointCB(point:any):any;
- export function getClientRect(el:Element|Window):any;
+ export function getClientRect(el:Element|Window):{ top:number, bottom:number, left:number, right:number };
export function pointInside(point:any, el:Element|Window):any;
}
diff --git a/modules/backlogs/app/views/project_settings/backlogs_settings.html.erb b/modules/backlogs/app/views/project_settings/backlogs_settings.html.erb
index ed37f503fdc..e6db05b0776 100644
--- a/modules/backlogs/app/views/project_settings/backlogs_settings.html.erb
+++ b/modules/backlogs/app/views/project_settings/backlogs_settings.html.erb
@@ -37,8 +37,8 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table" id="material_budget_items">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/modules/budgets/app/views/budgets/_list.html.erb b/modules/budgets/app/views/budgets/_list.html.erb
index fa84011221c..40d4e482036 100644
--- a/modules/budgets/app/views/budgets/_list.html.erb
+++ b/modules/budgets/app/views/budgets/_list.html.erb
@@ -33,12 +33,12 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table" id="material_budget_items">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/modules/budgets/app/views/budgets/_show.html.erb b/modules/budgets/app/views/budgets/_show.html.erb
index fcc5148ba4e..71d1d6db4b0 100644
--- a/modules/budgets/app/views/budgets/_show.html.erb
+++ b/modules/budgets/app/views/budgets/_show.html.erb
@@ -39,10 +39,10 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table material_budget_items">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
@@ -122,10 +122,10 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table material_budget_items">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
@@ -232,10 +232,10 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table labor_budget_items">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
@@ -319,10 +319,10 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table labor_budget_items">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/modules/budgets/app/views/budgets/subform/_labor_budget_subform.html.erb b/modules/budgets/app/views/budgets/subform/_labor_budget_subform.html.erb
index ec3b7aedbb2..798d7ffb159 100644
--- a/modules/budgets/app/views/budgets/subform/_labor_budget_subform.html.erb
+++ b/modules/budgets/app/views/budgets/subform/_labor_budget_subform.html.erb
@@ -40,11 +40,11 @@ end -%>
<div class="generic-table--results-container">
<table class="generic-table" id="labor_budget_items">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<% if User.current.allowed_to?(:view_cost_rates, @project)%>
- <col highlight-col>
+ <col opHighlightCol>
<%end%>
<col>
</colgroup>
diff --git a/modules/budgets/app/views/budgets/subform/_material_budget_subform.html.erb b/modules/budgets/app/views/budgets/subform/_material_budget_subform.html.erb
index dea52a3e842..841d85e73ce 100644
--- a/modules/budgets/app/views/budgets/subform/_material_budget_subform.html.erb
+++ b/modules/budgets/app/views/budgets/subform/_material_budget_subform.html.erb
@@ -39,11 +39,11 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table" id="material_budget_items">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<% if User.current.allowed_to?(:view_cost_rates, @project)%>
- <col highlight-col>
+ <col opHighlightCol>
<%end%>
<col>
</colgroup>
diff --git a/modules/costs/app/views/cost_types/_list.html.erb b/modules/costs/app/views/cost_types/_list.html.erb
index d06f3f5cea1..2c253ea5184 100644
--- a/modules/costs/app/views/cost_types/_list.html.erb
+++ b/modules/costs/app/views/cost_types/_list.html.erb
@@ -36,12 +36,12 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/modules/costs/app/views/cost_types/_list_deleted.html.erb b/modules/costs/app/views/cost_types/_list_deleted.html.erb
index 2d97fd2ca73..2161bbf456d 100644
--- a/modules/costs/app/views/cost_types/_list_deleted.html.erb
+++ b/modules/costs/app/views/cost_types/_list_deleted.html.erb
@@ -36,11 +36,11 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table locked_cost_types">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/modules/costs/app/views/cost_types/edit.html.erb b/modules/costs/app/views/cost_types/edit.html.erb
index 88e4bb5aee9..fa466bbf7b3 100644
--- a/modules/costs/app/views/cost_types/edit.html.erb
+++ b/modules/costs/app/views/cost_types/edit.html.erb
@@ -61,8 +61,8 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/modules/costs/app/views/hourly_rates/_list_default.html.erb b/modules/costs/app/views/hourly_rates/_list_default.html.erb
index 532fec90690..02256c724dc 100644
--- a/modules/costs/app/views/hourly_rates/_list_default.html.erb
+++ b/modules/costs/app/views/hourly_rates/_list_default.html.erb
@@ -38,9 +38,9 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table rates">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/modules/costs/app/views/hourly_rates/_list_project.html.erb b/modules/costs/app/views/hourly_rates/_list_project.html.erb
index 85c292c6508..48227c31ac9 100644
--- a/modules/costs/app/views/hourly_rates/_list_project.html.erb
+++ b/modules/costs/app/views/hourly_rates/_list_project.html.erb
@@ -51,9 +51,9 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table rates">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/modules/costs/app/views/hourly_rates/edit.html.erb b/modules/costs/app/views/hourly_rates/edit.html.erb
index 2c1093567b2..7a0793a94c2 100644
--- a/modules/costs/app/views/hourly_rates/edit.html.erb
+++ b/modules/costs/app/views/hourly_rates/edit.html.erb
@@ -48,8 +48,8 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table rates" width="200px">
<colgroup>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/modules/meeting/app/views/meeting_contents/history.html.erb b/modules/meeting/app/views/meeting_contents/history.html.erb
index 0d2ebccc5d1..0bb41dd833f 100644
--- a/modules/meeting/app/views/meeting_contents/history.html.erb
+++ b/modules/meeting/app/views/meeting_contents/history.html.erb
@@ -43,12 +43,12 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
+ <col opHighlightCol>
<col>
<col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
</colgroup>
<thead>
<tr>
diff --git a/modules/pdf_export/app/views/export_card_configurations/index.html.erb b/modules/pdf_export/app/views/export_card_configurations/index.html.erb
index 72cf93f53b3..d95125fe939 100644
--- a/modules/pdf_export/app/views/export_card_configurations/index.html.erb
+++ b/modules/pdf_export/app/views/export_card_configurations/index.html.erb
@@ -35,11 +35,11 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="generic-table--results-container">
<table class="generic-table">
<colgroup>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
- <col highlight-col>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
+ <col opHighlightCol>
<col>
</colgroup>
<thead>
diff --git a/modules/reporting/lib/widget/table/entry_table.rb b/modules/reporting/lib/widget/table/entry_table.rb
index e1b6f1b837e..525c3f63436 100644
--- a/modules/reporting/lib/widget/table/entry_table.rb
+++ b/modules/reporting/lib/widget/table/entry_table.rb
@@ -50,10 +50,10 @@ class ::Widget::Table::EntryTable < ::Widget::Table
def colgroup
content_tag :colgroup do
FIELDS.each do
- concat content_tag(:col, 'highlight-col' => true) {}
+ concat content_tag(:col, 'opHighlightCol' => true) {}
end
- concat content_tag(:col, 'highlight-col' => true) {}
- concat content_tag(:col, 'highlight-col' => true) {}
+ concat content_tag(:col, 'opHighlightCol' => true) {}
+ concat content_tag(:col, 'opHighlightCol' => true) {}
concat content_tag(:col) {}
end
end