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

Fix eslint errors

Dombi Attila190a2e8935e9
diff --git a/frontend/src/app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service.ts b/frontend/src/app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service.ts
index edd69aba01e..43031447f41 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service.ts
+++ b/frontend/src/app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service.ts
@@ -109,7 +109,7 @@ export class WorkPackageContextMenuHelperService {
link = this.PathHelper.workPackageShortPath(workPackage.id as string);
break;
default:
- link = action.link ? (workPackage[action.link as string] as HalLink).href as string : undefined;
+ link = action.link ? (workPackage[action.link] as HalLink).href as string : undefined;
}
return link;
@@ -153,13 +153,13 @@ export class WorkPackageContextMenuHelperService {
const allowedActions:WorkPackageAction[] = [];
_.each(actions, (action) => {
- if (action.link && workPackage[action.link as string] !== undefined) {
+ if (action.link && workPackage[action.link] !== undefined) {
action.text = action.text || I18n.t(`js.button_${action.key}`);
allowedActions.push(action);
}
});
- _.each(this.HookService.call('workPackageTableContextMenu'), (action) => {
+ _.each(this.HookService.call('workPackageTableContextMenu'), (action:WorkPackageAction) => {
if (workPackage[action.link as string] !== undefined) {
const index = action.indexBy ? action.indexBy(allowedActions) : allowedActions.length;
allowedActions.splice(index, 0, action);
diff --git a/frontend/src/app/shared/components/modals/get-ical-url-modal/query-get-ical-url.modal.ts b/frontend/src/app/shared/components/modals/get-ical-url-modal/query-get-ical-url.modal.ts
index 05ea1822d30..00f12875875 100644
--- a/frontend/src/app/shared/components/modals/get-ical-url-modal/query-get-ical-url.modal.ts
+++ b/frontend/src/app/shared/components/modals/get-ical-url-modal/query-get-ical-url.modal.ts
@@ -136,7 +136,7 @@ export class QueryGetIcalUrlModalComponent extends OpModalComponent implements O
void promise
.then((response:{ icalUrl:{ href:string } }) => {
- this.copyToClipboardService.copy(String(response.icalUrl.href))
+ this.copyToClipboardService.copy(String(response.icalUrl.href));
this.closeMe();
})
.catch((error:{ message:string }) => {
diff --git a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts
index ec1be0e39d7..7524fa3bbde 100644
--- a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts
+++ b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts
@@ -74,10 +74,11 @@ export class WorkPackageSingleContextMenuDirective extends OpContextMenuTrigger
// do nothing, the user closed without changes
});
break;
- case 'copy_to_clipboard':
- const url = new URL(link!, window.location.origin);
+ case 'copy_to_clipboard': {
+ const url = new URL(String(link), window.location.origin);
this.copyToClipboardService.copy(url.toString());
break;
+ }
default:
window.location.href = link!;
break;
diff --git a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts
index 2ecb67b980e..d0a6537e25b 100644
--- a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts
+++ b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts
@@ -96,11 +96,11 @@ export class WorkPackageViewContextMenu extends OpContextMenuHandler {
this.copySelectedWorkPackages(link!);
break;
- case 'copy_to_clipboard':
- const url = new URL(link!, window.location.origin);
+ case 'copy_to_clipboard': {
+ const url = new URL(String(link), window.location.origin);
this.copyToClipboardService.copy(url.toString());
break;
-
+ }
case 'copy_to_other_project':
window.location.href = `${this.pathHelper.staticBase}/work_packages/move/new?copy=true&ids[]=${id}`;
break;