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

TS type fixes: rehab npm run generate-typings

Alexander Brandon Colesa5db3f94106a
diff --git a/frontend/src/app/features/hal/resources/hal-resource.ts b/frontend/src/app/features/hal/resources/hal-resource.ts
index 46b769a787d..d62cce6b649 100644
--- a/frontend/src/app/features/hal/resources/hal-resource.ts
+++ b/frontend/src/app/features/hal/resources/hal-resource.ts
@@ -259,7 +259,7 @@ export class HalResource {
});
}
- protected $loadResource(force = false):Promise<this> {
+ $loadResource(force = false):Promise<this> {
if (!force) {
if (this.$loaded) {
return Promise.resolve(this);
diff --git a/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts b/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
index 2bcfadd1e9e..4f8df7d0c58 100644
--- a/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
+++ b/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
@@ -38,7 +38,7 @@ import {
ViewChild,
} from '@angular/core';
import { CalendarOptions, DateSelectArg, EventApi, EventDropArg, EventInput } from '@fullcalendar/core';
-import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
+import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs';
import {
debounceTime,
distinctUntilChanged,
@@ -143,7 +143,7 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
calendarOptions$ = new Subject<CalendarOptions>();
- draggingItem$ = new BehaviorSubject<EventDragStartArg|undefined>(undefined);
+ draggingItem$:BehaviorSubject<EventDragStartArg|undefined> = new BehaviorSubject(undefined);
globalDraggingItem$ = combineLatest([
this.draggingItem$,
@@ -176,7 +176,7 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
}),
);
- dropzone$ = combineLatest([
+ dropzone$:Observable<{ dragging:EventDragStartArg|undefined; isHovering:boolean; canDrop:boolean }> = combineLatest([
this.draggingItem$,
this.dropzoneHovered$,
this.dropzoneAllowed$,
diff --git a/frontend/src/app/shared/components/grids/widgets/wp-graph/wp-graph.component.ts b/frontend/src/app/shared/components/grids/widgets/wp-graph/wp-graph.component.ts
index cc6296fedfa..e8625e60ade 100644
--- a/frontend/src/app/shared/components/grids/widgets/wp-graph/wp-graph.component.ts
+++ b/frontend/src/app/shared/components/grids/widgets/wp-graph/wp-graph.component.ts
@@ -77,7 +77,7 @@ export class WidgetWpGraphComponent extends AbstractWidgetComponent implements O
});
}
- public get chartOptions() {
+ public get chartOptions():ChartOptions {
return this.graphConfiguration.chartOptions;
}
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 2c177a0cd60..4efd8ac70ba 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
@@ -1,6 +1,6 @@
import { Component, Input, SimpleChanges } from '@angular/core';
import { WorkPackageTableConfiguration } from 'core-app/features/work-packages/components/wp-table/wp-table-configuration';
-import { ChartOptions } from 'chart.js';
+import { ChartOptions, Plugin } from 'chart.js';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { GroupObject } from 'core-app/features/hal/resources/wp-collection-resource';
import DataLabelsPlugin from 'chartjs-plugin-datalabels';
@@ -38,7 +38,7 @@ export class WorkPackageEmbeddedGraphComponent {
public chartData:ChartDataSet[] = [];
- public chartPlugins = [DataLabelsPlugin];
+ public chartPlugins:Plugin[] = [DataLabelsPlugin];
public internalChartOptions:ChartOptions;
diff --git a/frontend/src/react/OpBlockNoteContainer.tsx b/frontend/src/react/OpBlockNoteContainer.tsx
index 84a133c7abf..26d6cc483ca 100644
--- a/frontend/src/react/OpBlockNoteContainer.tsx
+++ b/frontend/src/react/OpBlockNoteContainer.tsx
@@ -34,7 +34,7 @@ import { getDefaultReactSlashMenuItems, SuggestionMenuController, useCreateBlock
import { dummyBlockSpec, getDefaultOpenProjectSlashMenuItems, openProjectWorkPackageBlockSpec } from "op-blocknote-extensions";
import { useEffect, useState } from "react";
-interface OpBlockNoteContainerProps {
+export interface OpBlockNoteContainerProps {
inputField: HTMLInputElement;
inputText?: string;
}
diff --git a/modules/documents/frontend/module/hal/resources/document-resource.ts b/modules/documents/frontend/module/hal/resources/document-resource.ts
index 7dd880bafa1..69b437a2c27 100644
--- a/modules/documents/frontend/module/hal/resources/document-resource.ts
+++ b/modules/documents/frontend/module/hal/resources/document-resource.ts
@@ -41,6 +41,6 @@ class DocumentBaseResource extends HalResource {
private attachmentsBackend = false;
}
-export const DocumentResource = Attachable(DocumentBaseResource);
+export type DocumentResource = DocumentBaseResource & InstanceType<ReturnType<typeof Attachable>>;
-export type DocumentResource = DocumentBaseResource;
+export const DocumentResource: typeof DocumentBaseResource & ReturnType<typeof Attachable> = Attachable(DocumentBaseResource);