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

Merge branch 'release/11.4' into dev

Markus Kahld86e2787c788
diff --cc frontend/package.json
index a44b7a0d80a,36ffdc3d9d6..5a9203ba08f
--- a/frontend/package.json
+++ b/frontend/package.json
@@@ -5,48 -5,24 +5,49 @@@
"version": "0.1.0",
"private": true,
"devDependencies": {
- "@angular-eslint/builder": "1.2.0",
- "@angular-eslint/eslint-plugin": "1.2.0",
- "@angular-eslint/eslint-plugin-template": "1.2.0",
- "@angular-eslint/schematics": "1.2.0",
- "@angular-eslint/template-parser": "1.2.0",
- "@angular/language-service": "11.2.3",
+ "@angular-devkit/build-angular": "~12.2.6",
+ "@angular-eslint/builder": "^12.0.0",
+ "@angular-eslint/eslint-plugin": "^12.0.0",
+ "@angular-eslint/eslint-plugin-template": "^12.0.0",
+ "@angular-eslint/schematics": "12.5.0",
+ "@angular-eslint/template-parser": "^12.0.0",
+ "@angular/language-service": "12.2.6",
+ "@html-eslint/eslint-plugin": "^0.11.0",
+ "@html-eslint/parser": "^0.11.0",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
+ "@types/chart.js": "^2.9.20",
+ "@types/codemirror": "0.0.87",
+ "@types/dragula": "^3.7.0",
+ "@types/hammerjs": "^2.0.36",
"@types/jasmine": "~3.6.0",
+ "@types/jquery": "^3.3.33",
+ "@types/jqueryui": "^1.12.10",
+ "@types/lodash": "^4.14.149",
+ "@types/moment-timezone": "^0.5.12",
+ "@types/mousetrap": "^1.6.3",
+ "@types/pako": "^1.0.1",
+ "@types/resize-observer-browser": "^0.1.4",
+ "@types/swagger-ui": "^3.47.0",
+ "@types/urijs": "^1.19.6",
+ "@types/webpack-env": "^1.16.0",
+ "@typescript-eslint/eslint-plugin": "4.23.0",
+ "@typescript-eslint/parser": "4.23.0",
+ "browserslist": "^4.9.1",
+ "@types/mime": "^2.0.3",
- "@typescript-eslint/eslint-plugin": "^4.16.1",
- "@typescript-eslint/parser": "^4.16.1",
"codelyzer": "^6.0.0",
- "eslint": "^7.21.0",
+ "eslint": "^7.26.0",
"eslint-config-airbnb-base": "^14.2.1",
+ "eslint-config-airbnb-typescript": "^12.3.1",
+ "eslint-plugin-change-detection-strategy": "^0.1.1",
"eslint-plugin-import": "^2.22.1",
+ "eslint-plugin-jasmine": "^4.1.2",
+ "eslint-plugin-jsx-a11y": "^6.4.1",
+ "eslint-plugin-react": "^7.24.0",
+ "eslint-plugin-react-hooks": "^4.2.0",
+ "esprint": "^3.1.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
- "karma": "~5.0.0",
+ "karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
@@@ -88,9 -72,9 +89,9 @@@
"@uirouter/core": "^6.0.7",
"@uirouter/rx": "^0.6.5",
"@w11k/ngx-componentdestroyed": "^5.0.2",
- "@xeokit/xeokit-bim-viewer": "2.3.6",
+ "@xeokit/xeokit-bim-viewer": "2.3.10",
"autoprefixer": "^9.6.1",
- "browserslist": "^4.9.1",
+ "byte-base64": "^1.1.0",
"cdk-drag-scroll": "^0.0.6",
"chart.js": "2.9.4",
"chartjs-plugin-datalabels": "^0.6.0",
diff --cc frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.ts
index ccf4a22c428,69988a5ee76..48d5ce3e269
--- a/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.ts
+++ b/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.ts
@@@ -35,15 -36,16 +36,16 @@@ import
OnInit,
ViewChild,
} from '@angular/core';
-import { IFCViewerService } from 'core-app/modules/bim/ifc_models/ifc-viewer/ifc-viewer.service';
-import { IfcModelsDataService } from 'core-app/modules/bim/ifc_models/pages/viewer/ifc-models-data.service';
-import { I18nService } from 'core-app/modules/common/i18n/i18n.service';
-import { CurrentUserService } from 'core-app/modules/current-user/current-user.service';
-import { CurrentProjectService } from 'core-app/components/projects/current-project.service';
+import { IFCViewerService } from 'core-app/features/bim/ifc_models/ifc-viewer/ifc-viewer.service';
+import { IfcModelsDataService } from 'core-app/features/bim/ifc_models/pages/viewer/ifc-models-data.service';
+import { I18nService } from 'core-app/core/i18n/i18n.service';
+import { CurrentUserService } from 'core-app/core/current-user/current-user.service';
+import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
- import { BehaviorSubject } from 'rxjs';
+ import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
+ import { take } from "rxjs/operators";
@Component({
- selector: 'ifc-viewer',
+ selector: 'op-ifc-viewer',
templateUrl: './ifc-viewer.component.html',
styleUrls: ['./ifc-viewer.component.sass'],
changeDetection: ChangeDetectionStrategy.OnPush,
diff --cc frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.service.ts
index ad562e1cce7,36e7017c1e1..8d430ad3a45
--- a/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.service.ts
+++ b/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.service.ts
@@@ -1,16 -1,15 +1,15 @@@
import { Injectable, Injector } from '@angular/core';
-import { XeokitServer } from 'core-app/modules/bim/ifc_models/xeokit/xeokit-server';
-import { BcfViewpointInterface } from 'core-app/modules/bim/bcf/api/viewpoints/bcf-viewpoint.interface';
-import { ViewerBridgeService } from 'core-app/modules/bim/bcf/bcf-viewer-bridge/viewer-bridge.service';
+import { XeokitServer } from 'core-app/features/bim/ifc_models/xeokit/xeokit-server';
+import { BcfViewpointInterface } from 'core-app/features/bim/bcf/api/viewpoints/bcf-viewpoint.interface';
+import { ViewerBridgeService } from 'core-app/features/bim/bcf/bcf-viewer-bridge/viewer-bridge.service';
import { BehaviorSubject, Observable, of } from 'rxjs';
-import { WorkPackageResource } from 'core-app/modules/hal/resources/work-package-resource';
-import { PathHelperService } from 'core-app/modules/common/path-helper/path-helper.service';
-import { BcfApiService } from 'core-app/modules/bim/bcf/api/bcf-api.service';
-import { InjectField } from 'core-app/helpers/angular/inject-field.decorator';
-import { ViewpointsService } from 'core-app/modules/bim/bcf/helper/viewpoints.service';
-import { CurrentProjectService } from 'core-app/components/projects/current-project.service';
+import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
+import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
+import { BcfApiService } from 'core-app/features/bim/bcf/api/bcf-api.service';
+import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
+import { ViewpointsService } from 'core-app/features/bim/bcf/helper/viewpoints.service';
+import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import { HttpClient } from '@angular/common/http';
- import idFromLink from 'core-app/features/hal/helpers/id-from-link';
export interface XeokitElements {
canvasElement:HTMLElement;
diff --cc frontend/src/app/features/bim/revit_add_in/revit-bridge.service.ts
index 4d540dda539,38b1f186c4e..ef19dd47998
--- a/frontend/src/app/features/bim/revit_add_in/revit-bridge.service.ts
+++ b/frontend/src/app/features/bim/revit_add_in/revit-bridge.service.ts
@@@ -1,13 -1,12 +1,11 @@@
import { Injectable, Injector } from '@angular/core';
- import { BehaviorSubject, Observable, Subject } from 'rxjs';
- import {
- distinctUntilChanged, filter, first, map,
- } from 'rxjs/operators';
+ import { Observable, Subject, BehaviorSubject } from "rxjs";
-import { distinctUntilChanged, filter, first, map } from "rxjs/operators";
-import { BcfViewpointInterface } from "core-app/modules/bim/bcf/api/viewpoints/bcf-viewpoint.interface";
-import { ViewerBridgeService } from "core-app/modules/bim/bcf/bcf-viewer-bridge/viewer-bridge.service";
-import { WorkPackageResource } from "core-app/modules/hal/resources/work-package-resource";
-import { ViewpointsService } from "core-app/modules/bim/bcf/helper/viewpoints.service";
-import { InjectField } from "core-app/helpers/angular/inject-field.decorator";
-
++import { distinctUntilChanged, filter, first, map } from 'rxjs/operators';
+import { BcfViewpointInterface } from 'core-app/features/bim/bcf/api/viewpoints/bcf-viewpoint.interface';
+import { ViewerBridgeService } from 'core-app/features/bim/bcf/bcf-viewer-bridge/viewer-bridge.service';
+import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
+import { ViewpointsService } from 'core-app/features/bim/bcf/helper/viewpoints.service';
+import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
declare global {
interface Window {
diff --cc frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
index fe364a965c4,00000000000..28024a78c02
mode 100644,000000..100644
--- a/frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
+++ b/frontend/src/app/shared/directives/a11y/keyboard-shortcut.service.ts
@@@ -1,173 -1,0 +1,180 @@@
+// -- 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 COPYRIGHT and LICENSE files for more details.
+//++
+
+import { Injectable } from '@angular/core';
+import { FocusHelperService } from 'core-app/shared/directives/focus/focus-helper';
+import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
+import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
+
+const accessKeys = {
+ preview: 1,
+ newWorkPackage: 2,
+ edit: 3,
+ quickSearch: 4,
+ projectSearch: 5,
+ help: 6,
+ moreMenu: 7,
- details: 8,
++ details: 8
+};
+
+// this could be extracted into a separate component if it grows
- const accessibleListSelector = 'generic-table keyboard-accessible-list';
++const accessibleListSelector = 'table.keyboard-accessible-list';
++const accessibleRowSelector = 'table.keyboard-accessible-list tbody tr';
++
+
+@Injectable({
- providedIn: 'root',
++ providedIn: 'root'
+})
+export class KeyboardShortcutService {
++
+ // maybe move it to a .constant
+ private shortcuts:any = {
+ '?': () => this.showHelpModal(),
+ 'g m': this.globalAction('myPagePath'),
+ 'g o': this.projectScoped('projectPath'),
+ 'g w p': this.projectScoped('projectWorkPackagesPath'),
+ 'g w i': this.projectScoped('projectWikiPath'),
+ 'g a': this.projectScoped('projectActivityPath'),
+ 'g c': this.projectScoped('projectCalendarPath'),
+ 'g n': this.projectScoped('projectNewsPath'),
+ 'n w p': this.projectScoped('projectWorkPackageNewPath'),
+
+ 'g e': this.accessKey('edit'),
+ 'g p': this.accessKey('preview'),
+ 'd w p': this.accessKey('details'),
- m: this.accessKey('moreMenu'),
- p: this.accessKey('projectSearch'),
- s: this.accessKey('quickSearch'),
- k: () => this.focusPrevItem(),
- j: () => this.focusNextItem(),
++ 'm': this.accessKey('moreMenu'),
++ 'p': this.accessKey('projectSearch'),
++ 's': this.accessKey('quickSearch'),
++ 'k': () => this.focusPrevItem(),
++ 'j': () => this.focusNextItem()
+ };
+
++
+ constructor(private readonly PathHelper:PathHelperService,
- private readonly FocusHelper:FocusHelperService,
- private readonly currentProject:CurrentProjectService) {
++ private readonly FocusHelper:FocusHelperService,
++ private readonly currentProject:CurrentProjectService) {
+ this.register();
+ }
+
+ /**
+ * Register the keyboard shortcuts.
+ */
- public register():void {
++ public register() {
+ _.each(this.shortcuts, (action:() => void, key:string) => Mousetrap.bind(key, action));
+ }
+
- public accessKey(keyName:'preview'|'newWorkPackage'|'edit'|'quickSearch'|'projectSearch'|'help'|'moreMenu'|'details'):() => void {
- const key = accessKeys[keyName];
- return () => {
- // Guard: When the focus is on the IFC viewer, pressing the key "S" shall control the viewer as part of its
- // WASD navigation. So dismiss that shortcuts and let the event pass on to the IFC viewer.
- if (key === 4 &&
- document.activeElement?.getAttribute('data-qa-selector') === 'op-ifc-viewer--model-canvas') {
- return;
- }
++ public accessKey(keyName:'preview'|'newWorkPackage'|'edit'|'quickSearch'|'projectSearch'|'help'|'moreMenu'|'details') {
++ var key = accessKeys[keyName];
+
- // eslint-disable-next-line no-useless-concat
- const elem:HTMLElement = document.querySelectorAll("[accesskey='" + `${key}` + "']")[0] as HTMLElement;
- if (elem instanceof HTMLInputElement || elem.id === 'global-search-input') {
++ return () => {
++ var elem = jQuery('[accesskey=' + key + ']:first');
++ if (elem.is('input') || elem.attr('id') === 'global-search-input') {
+ // timeout with delay so that the key is not
+ // triggered on the input
- setTimeout(() => this.FocusHelper.focus(jQuery(elem)), 200);
- } else if (elem.getAttribute('href')) {
- this.clickLink(elem);
++ setTimeout(() => this.FocusHelper.focus(elem), 200);
++ } else if (elem.is('[href]')) {
++ this.clickLink(elem[0]);
+ } else {
- elem.click();
++ elem[0].click();
+ }
+ };
+ }
+
- public globalAction(action:keyof PathHelperService):() => void {
++ public globalAction(action:keyof PathHelperService) {
+ return () => {
- const url = (this.PathHelper[action] as any)();
++ var url = (this.PathHelper[action] as any)();
+ window.location.href = url;
+ };
+ }
+
- public projectScoped(action:keyof PathHelperService):() => void {
++ public projectScoped(action:keyof PathHelperService) {
+ return () => {
- const projectIdentifier = this.currentProject.identifier;
++ var projectIdentifier = this.currentProject.identifier;
+ if (projectIdentifier) {
- const url = (this.PathHelper[action] as any)(projectIdentifier);
++ var url = (this.PathHelper[action] as any)(projectIdentifier);
+ window.location.href = url;
+ }
+ };
+ }
+
- // eslint-disable-next-line class-methods-use-this
- clickLink(link:HTMLElement):void {
- if (!link.getAttribute('href')) {
- return;
- }
-
++ clickLink(link:any) {
+ const event = new MouseEvent('click', {
+ view: window,
+ bubbles: true,
- cancelable: true,
++ cancelable: true
+ });
+ const cancelled = !link.dispatchEvent(event);
+
+ if (!cancelled) {
- window.location.href = link.getAttribute('href') as string;
++ window.location.href = link.href;
+ }
+ }
+
- showHelpModal():void {
++ showHelpModal() {
+ window.open(this.PathHelper.keyboardShortcutsHelpPath());
+ }
+
- // eslint-disable-next-line class-methods-use-this
- focusItemOffset(offset:number):void {
- const list = document.getElementsByClassName(accessibleListSelector)[0];
++ findListInPage() {
++ const domLists = jQuery(accessibleListSelector);
++ const focusElements:any = [];
++ domLists.find('tbody tr').each(function (index, tr) {
++ var firstLink = jQuery(tr).find(':visible:tabbable')[0];
++ if (firstLink !== undefined) {
++ focusElements.push(firstLink);
++ }
++ });
++ return focusElements;
++ }
++
++ focusItemOffset(offset:number) {
++ const list = this.findListInPage();
++ let index;
++
+ if (list === null) {
+ return;
+ }
+
- const rows:Element[] = Array.from(list.querySelectorAll('tbody > tr'));
- let index:number;
- if (document.activeElement) {
- index = rows.indexOf(document.activeElement);
- const target = rows[index + offset] as HTMLElement;
- target.focus();
- }
++ index = list.indexOf(
++ jQuery(document.activeElement!)
++ .closest(accessibleRowSelector)
++ .find(':visible:tabbable')[0]
++ );
++
++ const target = jQuery(list[(index + offset + list.length) % list.length]);
++ target.focus();
++
+ }
+
- focusNextItem():void {
++ focusNextItem() {
+ this.focusItemOffset(1);
+ }
+
- focusPrevItem():void {
++ focusPrevItem() {
+ this.focusItemOffset(-1);
+ }
+}