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

Linting

Oliver Günther549cf77dafb0
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2c3e21e4d6e..85cea873593 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -172,9 +172,21 @@ module ApplicationHelper
end
def html_hours(text)
- text.gsub(%r{(\d+)\.(\d+)},
- '<span class="hours hours-int">\1</span><span class="hours hours-dec">.\2</span>')
- .html_safe
+ html_safe_gsub(text,
+ %r{(\d+)\.(\d+)},
+ '<span class="hours hours-int">\1</span><span class="hours hours-dec">.\2</span>')
+ end
+
+ def html_safe_gsub(string, *gsub_args, &)
+ html_safe = string.html_safe?
+ string.gsub(*gsub_args, &)
+
+ # We only mark the string as safe if the previous string was already safe
+ if html_safe
+ string.html_safe # rubocop:disable Rails/OutputSafety
+ else
+ string
+ end
end
def authoring(created, author, options = {})
@@ -252,11 +264,9 @@ module ApplicationHelper
# Same as Rails' simple_format helper without using paragraphs
def simple_format_without_paragraph(text)
- text.to_s
- .gsub(/\r\n?/, "\n") # \r\n and \r -> \n
- .gsub(/\n\n+/, "<br /><br />") # 2+ newline -> 2 br
- .gsub(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
- .html_safe
+ html_safe_gsub(text.to_s, /\r\n?/, "\n")
+ .then { |res| html_safe_gsub(res, /\n\n+/, "<br /><br />") }
+ .then { |res| html_safe_gsub(res, /([^\n]\n)(?=[^\n])/, '\1<br />') }
end
def lang_options_for_select(blank = true)
@@ -345,7 +355,7 @@ module ApplicationHelper
# A hash containing the following keys:
# * width: (default '100px') the css-width for the progress bar
# * legend: (default: '') the text displayed alond with the progress bar
- def progress_bar(pcts, options = {})
+ def progress_bar(pcts, options = {}) # rubocop:disable Metrics/AbcSize
pcts = Array(pcts).map(&:round)
closed = pcts[0]
done = pcts[1] || 0
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index 6d16917b363..e5c8951c2e2 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -63,7 +63,7 @@ module CustomFieldsHelper
end
# Return custom field html tag corresponding to its format
- def custom_field_tag(name, custom_value)
+ def custom_field_tag(name, custom_value) # rubocop:disable Metrics/AbcSize,Metrics/PerceivedComplexity
custom_field = custom_value.custom_field
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
field_id = "#{name}_custom_field_values_#{custom_field.id}"
@@ -143,7 +143,7 @@ module CustomFieldsHelper
custom_field_label_tag(name, custom_value) + custom_field_tag(name, custom_value)
end
- def custom_field_tag_for_bulk_edit(name, custom_field, project = nil)
+ def custom_field_tag_for_bulk_edit(name, custom_field, project = nil) # rubocop:disable Metrics/AbcSize
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
field_id = "#{name}_custom_field_values_#{custom_field.id}"
field_format = OpenProject::CustomFieldFormat.find_by_name(custom_field.field_format)
diff --git a/app/views/journals/_diff.html.erb b/app/views/journals/_diff.html.erb
index 0ebdab4b374..c07444eedc6 100644
--- a/app/views/journals/_diff.html.erb
+++ b/app/views/journals/_diff.html.erb
@@ -28,5 +28,5 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<div class="text-diff">
- <%= simple_format_without_paragraph diff.to_html %>
+ <%= simple_format_without_paragraph diff.to_html.html_safe %>
</div>
diff --git a/frontend/src/app/core/global_search/global-search-work-packages.component.ts b/frontend/src/app/core/global_search/global-search-work-packages.component.ts
index 38cb7edcd25..b6c22ff181f 100644
--- a/frontend/src/app/core/global_search/global-search-work-packages.component.ts
+++ b/frontend/src/app/core/global_search/global-search-work-packages.component.ts
@@ -36,28 +36,25 @@ import {
OnInit,
Renderer2,
} from '@angular/core';
-import { FocusHelperService } from 'core-app/shared/directives/focus/focus-helper';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
import { GlobalSearchService } from 'core-app/core/global_search/services/global-search.service';
-import { UrlParamsHelperService } from 'core-app/features/work-packages/components/wp-query/url-params-helper';
import {
- WorkPackageTableConfigurationObject
+ WorkPackageTableConfigurationObject,
} from 'core-app/features/work-packages/components/wp-table/wp-table-configuration';
import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/query-space/isolated-query-space';
import {
- WorkPackageViewFiltersService
+ WorkPackageViewFiltersService,
} from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
import { debounceTime, distinctUntilChanged, skip } from 'rxjs/operators';
import { combineLatest } from 'rxjs';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import {
- WorkPackageFiltersService
+ WorkPackageFiltersService,
} from 'core-app/features/work-packages/components/filters/wp-filters/wp-filters.service';
import {
- WorkPackageIsolatedQuerySpaceDirective
-} from "core-app/features/work-packages/directives/query-space/wp-isolated-query-space.directive";
-
+ WorkPackageIsolatedQuerySpaceDirective,
+} from 'core-app/features/work-packages/directives/query-space/wp-isolated-query-space.directive';
@Component({
selector: 'opce-global-search-work-packages',
@@ -72,6 +69,7 @@ import {
})
export class GlobalSearchWorkPackagesComponent extends UntilDestroyedMixin implements OnInit, OnDestroy, AfterViewInit {
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
public queryProps:{ [key:string]:any };
public resultsHidden = false;
@@ -87,7 +85,6 @@ export class GlobalSearchWorkPackagesComponent extends UntilDestroyedMixin imple
};
constructor(
- readonly FocusHelper:FocusHelperService,
readonly elementRef:ElementRef,
readonly renderer:Renderer2,
readonly I18n:I18nService,
@@ -97,7 +94,6 @@ export class GlobalSearchWorkPackagesComponent extends UntilDestroyedMixin imple
readonly querySpace:IsolatedQuerySpace,
readonly wpFilters:WorkPackageFiltersService,
readonly cdRef:ChangeDetectorRef,
- private UrlParamsHelper:UrlParamsHelperService,
) {
super();
}
@@ -113,7 +109,7 @@ export class GlobalSearchWorkPackagesComponent extends UntilDestroyedMixin imple
debounceTime(10),
this.untilDestroyed(),
)
- .subscribe(([]) => {
+ .subscribe(() => {
this.wpFilters.visible = false;
this.setQueryProps();
});
@@ -131,6 +127,7 @@ export class GlobalSearchWorkPackagesComponent extends UntilDestroyedMixin imple
}
private setQueryProps():void {
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
const filters:any[] = [];
let columns = ['id', 'project', 'subject', 'type', 'status', 'updatedAt'];
diff --git a/frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts b/frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts
index e71ebd37d06..13dbb323b80 100644
--- a/frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts
+++ b/frontend/src/app/core/global_search/tabs/global-search-tabs.component.ts
@@ -26,14 +26,13 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnDestroy, OnInit, } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnDestroy, OnInit } from '@angular/core';
import { StateService } from '@uirouter/core';
import { Subscription } from 'rxjs';
import { GlobalSearchService } from 'core-app/core/global_search/services/global-search.service';
import { ScrollableTabsComponent } from 'core-app/shared/components/tabs/scrollable-tabs/scrollable-tabs.component';
import { TabDefinition } from 'core-app/shared/components/tabs/tab.interface';
-
@Component({
selector: 'opce-global-search-tabs',
templateUrl: '../../../shared/components/tabs/scrollable-tabs/scrollable-tabs.component.html',
@@ -60,12 +59,14 @@ export class GlobalSearchTabsComponent extends ScrollableTabsComponent implement
this.currentTabSub = this.globalSearchService
.currentTab$
.subscribe((currentTab) => {
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */
this.currentTabId = currentTab;
});
this.tabsSub = this.globalSearchService
.tabs$
.subscribe((tabs) => {
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */
this.tabs = tabs;
this.tabs.map((tab) => (tab.path = '#'));
});
diff --git a/frontend/src/app/core/global_search/title/global-search-title.component.ts b/frontend/src/app/core/global_search/title/global-search-title.component.ts
index 5457936ed40..3477233e9b3 100644
--- a/frontend/src/app/core/global_search/title/global-search-title.component.ts
+++ b/frontend/src/app/core/global_search/title/global-search-title.component.ts
@@ -25,7 +25,15 @@
//
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectorRef, Component, ElementRef, Injector, Input, OnInit, } from '@angular/core';
+import {
+ ChangeDetectionStrategy,
+ ChangeDetectorRef,
+ Component,
+ ElementRef,
+ Injector,
+ Input,
+ OnInit,
+} from '@angular/core';
import { distinctUntilChanged } from 'rxjs/operators';
import { combineLatest } from 'rxjs';
import { I18nService } from 'core-app/core/i18n/i18n.service';
@@ -37,6 +45,7 @@ import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destr
@Component({
selector: 'opce-global-search-title',
templateUrl: './global-search-title.component.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class GlobalSearchTitleComponent extends UntilDestroyedMixin implements OnInit {
@Input() public searchTerm:string;
@@ -56,11 +65,13 @@ export class GlobalSearchTitleComponent extends UntilDestroyedMixin implements O
in: this.I18n.t('js.label_in'),
};
- constructor(readonly elementRef:ElementRef,
+ constructor(
+ readonly elementRef:ElementRef,
readonly cdRef:ChangeDetectorRef,
readonly globalSearchService:GlobalSearchService,
readonly I18n:I18nService,
- readonly injector:Injector) {
+ readonly injector:Injector,
+ ) {
super();
}
@@ -76,6 +87,7 @@ export class GlobalSearchTitleComponent extends UntilDestroyedMixin implements O
)
.subscribe(([newSearchTerm, newProjectScope]) => {
this.searchTerm = newSearchTerm;
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-argument */
this.project = this.projectText(newProjectScope);
this.searchTitle = `${this.text.search_for} ${this.searchTerm} ${this.project === '' ? '' : this.text.in} ${this.project}`;
diff --git a/frontend/src/app/core/main-menu/main-menu-toggle.component.ts b/frontend/src/app/core/main-menu/main-menu-toggle.component.ts
index 1bb85b01673..ad12425f592 100644
--- a/frontend/src/app/core/main-menu/main-menu-toggle.component.ts
+++ b/frontend/src/app/core/main-menu/main-menu-toggle.component.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnInit, } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnInit } from '@angular/core';
import { distinctUntilChanged } from 'rxjs/operators';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
@@ -34,10 +34,10 @@ import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destr
import { MainMenuToggleService } from './main-menu-toggle.service';
import { TopMenuService } from 'core-app/core/top-menu/top-menu.service';
-
@Component({
selector: 'opce-main-menu-toggle',
changeDetection: ChangeDetectionStrategy.OnPush,
+ // eslint-disable-next-line @angular-eslint/no-host-metadata-property
host: {
class: 'op-app-menu op-main-menu-toggle',
},
diff --git a/frontend/src/app/core/setup/globals/components/admin/backup.component.ts b/frontend/src/app/core/setup/globals/components/admin/backup.component.ts
index 19060a8745f..98107f98594 100644
--- a/frontend/src/app/core/setup/globals/components/admin/backup.component.ts
+++ b/frontend/src/app/core/setup/globals/components/admin/backup.component.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Injector, ViewChild, } from '@angular/core';
+import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Injector, ViewChild } from '@angular/core';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
@@ -37,7 +37,6 @@ import { OpenProjectBackupService } from 'core-app/core/backup/op-backup.service
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { HalError } from 'core-app/features/hal/services/hal-error';
-
@Component({
selector: 'opce-backup',
templateUrl: './backup.component.html',
@@ -57,15 +56,13 @@ export class BackupComponent implements AfterViewInit {
attachmentsDisabled: this.i18n.t('js.backup.attachments_disabled'),
};
- public jobStatusId:string = this.elementRef.nativeElement.dataset.jobStatusId;
-
- public lastBackupDate:string = this.elementRef.nativeElement.dataset.lastBackupDate;
+ public jobStatusId = this.elementRef.nativeElement.dataset.jobStatusId as string;
- public lastBackupAttachmentId:string = this.elementRef.nativeElement.dataset.lastBackupAttachmentId;
+ public lastBackupDate = this.elementRef.nativeElement.dataset.lastBackupDate as string;
- public mayIncludeAttachments:boolean = this.elementRef.nativeElement.dataset.mayIncludeAttachments != 'false';
+ public lastBackupAttachmentId = this.elementRef.nativeElement.dataset.lastBackupAttachmentId as string;
- public isInProgress = false;
+ public mayIncludeAttachments = this.elementRef.nativeElement.dataset.mayIncludeAttachments !== 'false';
public includeAttachments = true;
@@ -73,10 +70,10 @@ export class BackupComponent implements AfterViewInit {
@InjectField() opBackup:OpenProjectBackupService;
- @ViewChild('backupTokenInput') backupTokenInput:ElementRef;
+ @ViewChild('backupTokenInput') backupTokenInput:ElementRef<HTMLInputElement>;
constructor(
- readonly elementRef:ElementRef,
+ readonly elementRef:ElementRef<HTMLElement>,
public injector:Injector,
protected i18n:I18nService,
protected toastService:ToastService,
@@ -87,6 +84,7 @@ export class BackupComponent implements AfterViewInit {
}
ngAfterViewInit():void {
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-call */
this.backupTokenInput.nativeElement.focus();
}
@@ -99,10 +97,6 @@ export class BackupComponent implements AfterViewInit {
return this.pathHelper.attachmentDownloadPath(this.lastBackupAttachmentId, undefined);
}
- public includeAttachmentsDefault():boolean {
- return this.mayIncludeAttachments;
- }
-
public includeAttachmentsTitle():string {
return this.mayIncludeAttachments ? '' : this.text.attachmentsDisabled;
}
@@ -121,7 +115,7 @@ export class BackupComponent implements AfterViewInit {
.triggerBackup(backupToken, this.includeAttachments)
.subscribe(
(resp:HalResource) => {
- this.jobStatusId = resp.jobStatusId;
+ this.jobStatusId = resp.jobStatusId as string;
this.opModalService.show(JobStatusModalComponent, 'global', { jobId: resp.jobStatusId });
},
(error:HalError) => {
diff --git a/frontend/src/app/core/setup/globals/global-listeners/settings.ts b/frontend/src/app/core/setup/globals/global-listeners/settings.ts
index 181d4f3a321..0c01896dc86 100644
--- a/frontend/src/app/core/setup/globals/global-listeners/settings.ts
+++ b/frontend/src/app/core/setup/globals/global-listeners/settings.ts
@@ -31,8 +31,9 @@ export function listenToSettingChanges() {
const self = jQuery(select);
const id:string = self.attr('id') || '';
const settingName = id.replace('lang-for-', '');
- const newLang = self.val();
+ const newLang = self.val() as string;
const textArea = jQuery(`#settings-${settingName}`);
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */
const editor = textArea.siblings('opce-ckeditor-augmented-textarea').data('editor');
return {
diff --git a/frontend/src/app/features/admin/editable-query-props/editable-query-props.component.ts b/frontend/src/app/features/admin/editable-query-props/editable-query-props.component.ts
index 51486f66dda..30706c633fd 100644
--- a/frontend/src/app/features/admin/editable-query-props/editable-query-props.component.ts
+++ b/frontend/src/app/features/admin/editable-query-props/editable-query-props.component.ts
@@ -1,10 +1,8 @@
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, OnInit, } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, OnInit } from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import {
- ExternalQueryConfigurationService
+ ExternalQueryConfigurationService,
} from 'core-app/features/work-packages/components/wp-table/external-configuration/external-query-configuration.service';
-import { UrlParamsHelperService } from 'core-app/features/work-packages/components/wp-query/url-params-helper';
-
@Component({
selector: 'opce-editable-query-props',
@@ -24,29 +22,32 @@ export class EditableQueryPropsComponent implements OnInit {
edit_query: this.I18n.t('js.admin.type_form.edit_query'),
};
- constructor(private elementRef:ElementRef,
+ constructor(
+ private elementRef:ElementRef<HTMLElement>,
private I18n:I18nService,
private cdRef:ChangeDetectorRef,
- private urlParamsHelper:UrlParamsHelperService,
- private externalQuery:ExternalQueryConfigurationService) {
+ private externalQuery:ExternalQueryConfigurationService,
+ ) {
}
ngOnInit() {
const element = this.elementRef.nativeElement;
- this.id = element.dataset.id;
- this.name = element.dataset.name;
+ this.id = element.dataset.id as string;
+ this.name = element.dataset.name as string;
this.urlParams = element.dataset.urlParams === 'true';
- this.queryProps = element.dataset.query;
+ this.queryProps = element.dataset.query as string;
}
public editQuery() {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const queryProperties = (() => {
if (this.urlParams) {
return this.queryProps;
}
try {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
return JSON.parse(this.queryProps);
} catch (e) {
console.error(`Failed to parse query props from ${this.queryProps}: ${e}`);
@@ -55,9 +56,11 @@ export class EditableQueryPropsComponent implements OnInit {
})();
this.externalQuery.show({
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
currentQuery: queryProperties,
urlParams: this.urlParams,
- callback: (queryProps:any) => {
+ callback: (queryProps:string) => {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.queryProps = this.urlParams ? queryProps : JSON.stringify(queryProps);
this.cdRef.detectChanges();
},
diff --git a/frontend/src/app/features/admin/types/type-form-configuration.component.ts b/frontend/src/app/features/admin/types/type-form-configuration.component.ts
index b2618d6cb3d..b5984421959 100644
--- a/frontend/src/app/features/admin/types/type-form-configuration.component.ts
+++ b/frontend/src/app/features/admin/types/type-form-configuration.component.ts
@@ -1,8 +1,8 @@
-import { AfterViewInit, Component, ElementRef, OnInit, } from '@angular/core';
+import { AfterViewInit, Component, ElementRef, OnInit } from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import {
- ExternalRelationQueryConfigurationService
+ ExternalRelationQueryConfigurationService,
} from 'core-app/features/work-packages/components/wp-table/external-configuration/external-relation-query-configuration.service';
import { DomAutoscrollService } from 'core-app/shared/helpers/drag-and-drop/dom-autoscroll.service';
import { DragulaService, DrakeWithModels } from 'ng2-dragula';
@@ -30,7 +30,6 @@ export interface TypeGroup {
type:TypeGroupType;
}
-
export const emptyTypeGroup = '__empty';
@Component({
@@ -234,7 +233,8 @@ export class TypeFormConfigurationComponent extends UntilDestroyedMixin implemen
this.form.off('submit.typeformupdater');
this.form.trigger('submit');
})
- .catch(() => {});
+ .catch(() => {
+ });
$event.preventDefault();
return false;
diff --git a/frontend/src/app/features/enterprise/enterprise-base.component.ts b/frontend/src/app/features/enterprise/enterprise-base.component.ts
index 19a4f45e84a..1e0bb492621 100644
--- a/frontend/src/app/features/enterprise/enterprise-base.component.ts
+++ b/frontend/src/app/features/enterprise/enterprise-base.component.ts
@@ -26,17 +26,18 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { Component, Injector } from '@angular/core';
+import { ChangeDetectionStrategy, Component, Injector } from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { EnterpriseTrialModalComponent } from 'core-app/features/enterprise/enterprise-modal/enterprise-trial.modal';
import { OpModalService } from 'core-app/shared/components/modal/modal.service';
import { EnterpriseTrialService } from 'core-app/features/enterprise/enterprise-trial.service';
-
@Component({
+ // eslint-disable-next-line @angular-eslint/component-selector
selector: 'enterprise-base',
templateUrl: './enterprise-base.component.html',
styleUrls: ['./enterprise-base.component.sass'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class EnterpriseBaseComponent {
public text = {
@@ -51,10 +52,12 @@ export class EnterpriseBaseComponent {
try_another_email: this.I18n.t('js.admin.enterprise.trial.try_another_email'),
};
- constructor(protected I18n:I18nService,
+ constructor(
+ protected I18n:I18nService,
protected opModalService:OpModalService,
readonly injector:Injector,
- public eeTrialService:EnterpriseTrialService) {
+ public eeTrialService:EnterpriseTrialService,
+ ) {
}
public openTrialModal() {
diff --git a/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.ts b/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.ts
index 73caea8b37f..0b3f0e1ce80 100644
--- a/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.ts
+++ b/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnInit, } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnInit } from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { EnterpriseTrialModalComponent } from 'core-app/features/enterprise/enterprise-modal/enterprise-trial.modal';
import { OpModalService } from 'core-app/shared/components/modal/modal.service';
@@ -37,11 +37,11 @@ import { HttpClient } from '@angular/common/http';
import { GonService } from 'core-app/core/gon/gon.service';
import { IEnterpriseData } from 'core-app/features/enterprise/enterprise-trial.model';
-
export interface EETrialKey {
created:string;
value:string;
}
+
@Component({
selector: 'opce-free-trial-button',
templateUrl: './free-trial-button.component.html',
@@ -60,14 +60,16 @@ export class FreeTrialButtonComponent implements OnInit {
}),
};
- constructor(protected I18n:I18nService,
+ constructor(
+ protected I18n:I18nService,
protected opModalService:OpModalService,
readonly injector:Injector,
readonly http:HttpClient,
readonly cdRef:ChangeDetectorRef,
readonly Gon:GonService,
public eeTrialService:EnterpriseTrialService,
- readonly timezoneService:TimezoneService) {
+ readonly timezoneService:TimezoneService,
+ ) {
}
ngOnInit():void {
diff --git a/frontend/src/app/features/plugins/plugin-context.ts b/frontend/src/app/features/plugins/plugin-context.ts
index 1a2afbebff1..01e1604ceff 100644
--- a/frontend/src/app/features/plugins/plugin-context.ts
+++ b/frontend/src/app/features/plugins/plugin-context.ts
@@ -2,7 +2,7 @@ import { Injector, NgZone } from '@angular/core';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import {
- ExternalQueryConfigurationService
+ ExternalQueryConfigurationService,
} from 'core-app/features/work-packages/components/wp-table/external-configuration/external-query-configuration.service';
import { OpModalService } from 'core-app/shared/components/modal/modal.service';
import { DisplayField } from 'core-app/shared/components/fields/display/display-field.module';
@@ -13,7 +13,7 @@ import { EditFieldService } from 'core-app/shared/components/fields/edit/edit-fi
import { States } from 'core-app/core/states/states.service';
import { CKEditorPreviewService } from 'core-app/shared/components/editor/components/ckeditor/ckeditor-preview.service';
import {
- ExternalRelationQueryConfigurationService
+ ExternalRelationQueryConfigurationService,
} from 'core-app/features/work-packages/components/wp-table/external-configuration/external-relation-query-configuration.service';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -26,7 +26,7 @@ import { PathHelperService } from '../../core/path-helper/path-helper.service';
import { HTMLSanitizeService } from '../../core/html-sanitize/html-sanitize.service';
import { DynamicContentModalComponent } from '../../shared/components/modals/modal-wrapper/dynamic-content.modal';
import {
- PasswordConfirmationModalComponent
+ PasswordConfirmationModalComponent,
} from '../../shared/components/modals/request-for-confirmation/password-confirmation.modal';
import { DomAutoscrollService } from 'core-app/shared/helpers/drag-and-drop/dom-autoscroll.service';
import { AttachmentsResourceService } from 'core-app/core/state/attachments/attachments.service';
@@ -83,7 +83,8 @@ export class OpenProjectPluginContext {
};
// Hooks
- public readonly hooks:{ [hook:string]:(callback:Function) => void } = {};
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
+ public readonly hooks:{ [hook:string]:(callback:(...args:any[]) => unknown) => void } = {};
// Angular zone reference
@InjectField() public readonly zone:NgZone;
@@ -93,7 +94,7 @@ export class OpenProjectPluginContext {
this
._knownHookNames
.forEach((hook:string) => {
- this.hooks[hook] = (callback:Function) => this.services.hooks.register(hook, callback);
+ this.hooks[hook] = (callback:() => void) => this.services.hooks.register(hook, callback);
});
}
diff --git a/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts b/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts
index a40f604d9e1..228b3d6518d 100644
--- a/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts
@@ -43,10 +43,10 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import {
- WorkPackageCommentFieldHandler
+ WorkPackageCommentFieldHandler,
} from 'core-app/features/work-packages/components/work-package-comment/work-package-comment-field-handler';
import {
- WorkPackagesActivityService
+ WorkPackagesActivityService,
} from 'core-app/features/work-packages/components/wp-single-view-tabs/activity-panel/wp-activity.service';
import { CommentService } from 'core-app/features/work-packages/components/wp-activity/comment-service';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
@@ -56,6 +56,7 @@ import idFromLink from 'core-app/features/hal/helpers/id-from-link';
import { DeviceService } from 'core-app/core/browser/device.service';
@Component({
+ // eslint-disable-next-line @angular-eslint/component-selector
selector: 'user-activity',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './user-activity.component.html',
@@ -78,7 +79,7 @@ export class UserActivityComponent extends WorkPackageCommentFieldHandler implem
public userCanQuote = false;
- public userId:string | number;
+ public userId:string|number;
public user:UserResource;
@@ -164,7 +165,7 @@ export class UserActivityComponent extends WorkPackageCommentFieldHandler implem
return;
}
const activityElement = document.querySelectorAll(`[data-qa-activity-number='${this.activityNo}']`)[0] as HTMLElement;
- const scrollContainer = document.querySelectorAll("[data-notification-selector='notification-scroll-container']")[0];
+ const scrollContainer = document.querySelectorAll('[data-notification-selector=\'notification-scroll-container\']')[0];
const scrollOffset = activityElement.offsetTop - (scrollContainer as HTMLElement).offsetTop - this.additionalScrollMargin;
scrollContainer.scrollTop = scrollOffset;
});
@@ -200,11 +201,13 @@ export class UserActivityComponent extends WorkPackageCommentFieldHandler implem
return null;
}
- public async updateComment() {
+ public async updateComment():Promise<unknown> {
this.inFlight = true;
await this.onSubmit();
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-return
return this.commentService.updateComment(this.activity, this.rawComment || '')
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.then((newActivity:HalResource) => {
this.activity = newActivity;
this.updateCommentText();
@@ -215,8 +218,10 @@ export class UserActivityComponent extends WorkPackageCommentFieldHandler implem
.cache
.updateWorkPackage(this.workPackage);
})
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.finally(() => {
- this.deactivate(true); this.inFlight = false;
+ this.deactivate(true);
+ this.inFlight = false;
});
}
@@ -260,6 +265,7 @@ export class UserActivityComponent extends WorkPackageCommentFieldHandler implem
}
private updateCommentText() {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access
this.postedComment = this.sanitization.bypassSecurityTrustHtml(this.activity.comment.html);
}
}
diff --git a/frontend/src/app/features/work-packages/components/wp-custom-actions/date-action/custom-date-action-admin.component.ts b/frontend/src/app/features/work-packages/components/wp-custom-actions/date-action/custom-date-action-admin.component.ts
index 407ba4de615..0278f7cd92d 100644
--- a/frontend/src/app/features/work-packages/components/wp-custom-actions/date-action/custom-date-action-admin.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-custom-actions/date-action/custom-date-action-admin.component.ts
@@ -26,13 +26,20 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ApplicationRef, ChangeDetectorRef, Component, ElementRef, OnInit, } from '@angular/core';
+import {
+ ApplicationRef,
+ ChangeDetectionStrategy,
+ ChangeDetectorRef,
+ Component,
+ ElementRef,
+ OnInit,
+} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-
@Component({
selector: 'opce-custom-date-action-admin',
templateUrl: './custom-date-action-admin.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CustomDateActionAdminComponent implements OnInit {
public valueVisible = false;
@@ -43,6 +50,7 @@ export class CustomDateActionAdminComponent implements OnInit {
public visibleValue:string = '';
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
public selectedOperator:any;
private onKey = 'on';
@@ -56,10 +64,12 @@ export class CustomDateActionAdminComponent implements OnInit {
{ key: this.currentKey, label: this.I18n.t('js.custom_actions.date.current_date') },
];
- constructor(private elementRef:ElementRef,
+ constructor(
+ private elementRef:ElementRef,
private cdRef:ChangeDetectorRef,
public appRef:ApplicationRef,
- private I18n:I18nService) {
+ private I18n:I18nService,
+ ) {
}
// cannot use $onInit as it would be called before the operators gets filled
@@ -79,6 +89,7 @@ export class CustomDateActionAdminComponent implements OnInit {
}
public toggleValueVisibility() {
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
this.valueVisible = this.selectedOperator.key === this.onKey;
if (this.fieldValue === this.currentFieldValue) {
this.fieldValue = '';
@@ -88,6 +99,7 @@ export class CustomDateActionAdminComponent implements OnInit {
}
private updateDbValue() {
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
if (this.selectedOperator.key === this.currentKey) {
this.fieldValue = this.currentFieldValue;
}
diff --git a/frontend/src/app/shared/components/collapsible-section/collapsible-section.component.ts b/frontend/src/app/shared/components/collapsible-section/collapsible-section.component.ts
index 9c1b6ce0e24..7491a52a4ab 100644
--- a/frontend/src/app/shared/components/collapsible-section/collapsible-section.component.ts
+++ b/frontend/src/app/shared/components/collapsible-section/collapsible-section.component.ts
@@ -26,8 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { Component, ElementRef, OnInit, ViewChild, } from '@angular/core';
-
+import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
@Component({
selector: 'opce-opce-collapsible-section-augment',
diff --git a/frontend/src/app/shared/components/colors/colors-autocompleter.component.ts b/frontend/src/app/shared/components/colors/colors-autocompleter.component.ts
index e4c034f70e4..0f988b6c8f9 100644
--- a/frontend/src/app/shared/components/colors/colors-autocompleter.component.ts
+++ b/frontend/src/app/shared/components/colors/colors-autocompleter.component.ts
@@ -26,12 +26,17 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { Component, ElementRef, OnInit } from '@angular/core';
+import { ChangeDetectionStrategy, Component, ElementRef, OnInit } from '@angular/core';
import {
- Highlighting
+ Highlighting,
} from 'core-app/features/work-packages/components/wp-fast-table/builders/highlighting/highlighting.functions';
import { I18nService } from 'core-app/core/i18n/i18n.service';
+interface ColorItem {
+ name:string;
+ value:string;
+ selected?:boolean;
+}
@Component({
template: `
@@ -44,19 +49,20 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
[clearable]="false"
appendTo="body">
<ng-template ng-label-tmp let-item="item">
- <span [ngClass]="highlightColor(item)">{{item.name}}</span>
+ <span [ngClass]="highlightColor(item)">{{ item.name }}</span>
</ng-template>
<ng-template ng-option-tmp let-item="item" let-index="index">
- <span [ngClass]="highlightColor(item)">{{item.name}}</span>
+ <span [ngClass]="highlightColor(item)">{{ item.name }}</span>
</ng-template>
</ng-select>
`,
selector: 'opce-colors-autocompleter',
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ColorsAutocompleterComponent implements OnInit {
- public options:any[];
+ public options:ColorItem[];
- public selectedOption:any;
+ public selectedOption?:ColorItem|string;
private highlightTextInline = false;
@@ -64,25 +70,30 @@ export class ColorsAutocompleterComponent implements OnInit {
private selectedColorId:string;
- constructor(protected elementRef:ElementRef,
- protected readonly I18n:I18nService) {
+ constructor(
+ protected elementRef:ElementRef<HTMLElement>,
+ protected readonly I18n:I18nService,
+ ) {
}
ngOnInit() {
this.setColorOptions();
- this.updateInputField = document.getElementsByName(this.elementRef.nativeElement.dataset.updateInput)[0] as HTMLInputElement|undefined;
- this.highlightTextInline = JSON.parse(this.elementRef.nativeElement.dataset.highlightTextInline);
+ this.updateInputField = document.getElementsByName(this.elementRef.nativeElement.dataset.updateInput as string)[0] as HTMLInputElement|undefined;
+ this.highlightTextInline = JSON.parse(this.elementRef.nativeElement.dataset.highlightTextInline as string) as boolean;
}
- public onModelChange(color:any) {
+ public onModelChange(color:{ name:string, value:string }) {
if (color && this.updateInputField) {
this.updateInputField.value = color.value;
}
}
private setColorOptions() {
- this.options = JSON.parse(this.elementRef.nativeElement.dataset.colors);
+ this.options = JSON.parse(this.elementRef.nativeElement.dataset.colors as string) as {
+ name:string,
+ value:string
+ }[];
this.options.unshift({ name: this.I18n.t('js.label_no_color'), value: '' });
this.selectedOption = this.options.find((item) => item.selected === true);
@@ -91,14 +102,14 @@ export class ColorsAutocompleterComponent implements OnInit {
this.selectedOption = this.selectedOption.value;
} else {
// Differentiate between "No color" and a color that is now not selectable any more
- this.selectedColorId = this.elementRef.nativeElement.dataset.selectedColor;
+ this.selectedColorId = this.elementRef.nativeElement.dataset.selectedColor as string;
this.selectedOption = this.selectedColorId ? this.selectedColorId : '';
}
}
- private highlightColor(item:any) {
+ highlightColor(item:ColorItem):string|undefined {
if (item.value === '') {
- return;
+ return undefined;
}
let highlightingClass;
diff --git a/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.component.ts b/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.component.ts
index d7322f779db..e9bcd516fd3 100644
--- a/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.component.ts
+++ b/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.component.ts
@@ -26,13 +26,12 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, Component, ElementRef, OnInit, } from '@angular/core';
+import { ChangeDetectionStrategy, Component, ElementRef, OnInit } from '@angular/core';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { CopyToClipboardService } from './copy-to-clipboard.service';
-
@Component({
template: '',
selector: 'opce-copy-to-clipboard',
@@ -51,7 +50,8 @@ export class CopyToClipboardComponent implements OnInit {
readonly elementRef:ElementRef,
readonly I18n:I18nService,
protected copyToClipboardService:CopyToClipboardService,
- ) { }
+ ) {
+ }
ngOnInit() {
const element = this.elementRef.nativeElement;
diff --git a/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor-preview.service.ts b/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor-preview.service.ts
index 8d2ec30c9a5..c9907c3507e 100644
--- a/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor-preview.service.ts
+++ b/frontend/src/app/shared/components/editor/components/ckeditor/ckeditor-preview.service.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ApplicationRef, ComponentFactoryResolver, ComponentRef, Injectable, Injector, } from '@angular/core';
+import { ApplicationRef, ComponentFactoryResolver, ComponentRef, Injectable, Injector } from '@angular/core';
@Injectable()
export class CKEditorPreviewService {
diff --git a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
index 82052c1fb1d..b2206c734c1 100644
--- a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
+++ b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
@@ -1,4 +1,4 @@
-import { ChangeDetectionStrategy, Component, ElementRef, Injector, Input, OnInit, } from '@angular/core';
+import { ChangeDetectionStrategy, Component, ElementRef, Injector, Input, OnInit } from '@angular/core';
import { BannersService } from 'core-app/core/enterprise/banners.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { imagePath } from 'core-app/shared/helpers/images/path-helper';
@@ -7,7 +7,6 @@ import { PathHelperService } from 'core-app/core/path-helper/path-helper.service
import { populateInputsFromDataset } from 'core-app/shared/components/dataset-inputs';
import { pricingUrl } from 'core-app/core/setup/globals/constants.const';
-
@Component({
selector: 'op-enterprise-banner',
changeDetection: ChangeDetectionStrategy.OnPush,
diff --git a/frontend/src/app/shared/components/enterprise-page/enterprise-page.component.ts b/frontend/src/app/shared/components/enterprise-page/enterprise-page.component.ts
index 0c12e1444f9..d2313ffa800 100644
--- a/frontend/src/app/shared/components/enterprise-page/enterprise-page.component.ts
+++ b/frontend/src/app/shared/components/enterprise-page/enterprise-page.component.ts
@@ -1,4 +1,4 @@
-import { ChangeDetectionStrategy, Component, ElementRef, Input, } from '@angular/core';
+import { ChangeDetectionStrategy, Component, ElementRef, Input } from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { imagePath } from 'core-app/shared/helpers/images/path-helper';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
diff --git a/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text.component.ts b/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text.component.ts
index 9b2605731bf..9ce75d2a0d8 100644
--- a/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text.component.ts
+++ b/frontend/src/app/shared/components/grids/widgets/custom-text/custom-text.component.ts
@@ -13,7 +13,7 @@ import {
ViewChild,
} from '@angular/core';
import {
- CustomTextEditFieldService
+ CustomTextEditFieldService,
} from 'core-app/shared/components/grids/widgets/custom-text/custom-text-edit-field.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
@@ -61,9 +61,9 @@ export class WidgetCustomTextComponent extends AbstractWidgetComponent implement
this.untilDestroyed(),
filter((value) => value !== this.resource.options.text),
).subscribe((newText) => {
- const changeset = this.setChangesetOptions({ text: { raw: newText } });
- this.resourceChanged.emit(changeset);
- });
+ const changeset = this.setChangesetOptions({ text: { raw: newText } });
+ this.resourceChanged.emit(changeset);
+ });
}
ngOnChanges(changes:SimpleChanges):void {
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 66dca3c4006..7e1e64ed519 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
@@ -27,7 +27,7 @@
//++
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { Component, ElementRef, OnInit, ViewChild, } from '@angular/core';
+import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import {
HideSectionDefinition,
HideSectionService,
@@ -53,9 +53,11 @@ export class AddSectionDropdownComponent extends UntilDestroyedMixin implements
public placeholder = this.I18n.t('js.placeholders.selection');
- constructor(protected hideSectionService:HideSectionService,
+ constructor(
+ protected hideSectionService:HideSectionService,
protected elementRef:ElementRef,
- protected I18n:I18nService) {
+ protected I18n:I18nService,
+ ) {
super();
}
@@ -68,12 +70,12 @@ export class AddSectionDropdownComponent extends UntilDestroyedMixin implements
.pipe(
this.untilDestroyed(),
).subscribe((displayed) => {
- this.selectable = this.hideSectionService.all
- .filter((el) => displayed.indexOf(el.key) === -1)
- .sort((a, b) => a.label.localeCompare(b.label));
+ this.selectable = this.hideSectionService.all
+ .filter((el) => displayed.indexOf(el.key) === -1)
+ .sort((a, b) => a.label.localeCompare(b.label));
- (this.option.nativeElement as HTMLOptionElement).selected = true;
- });
+ (this.option.nativeElement as HTMLOptionElement).selected = true;
+ });
}
show(value:string) {
diff --git a/frontend/src/app/shared/components/modal/modal-overlay.component.ts b/frontend/src/app/shared/components/modal/modal-overlay.component.ts
index 50cd8fe72b8..009806f6626 100644
--- a/frontend/src/app/shared/components/modal/modal-overlay.component.ts
+++ b/frontend/src/app/shared/components/modal/modal-overlay.component.ts
@@ -34,7 +34,7 @@ import {
ElementRef,
ViewChild,
} from '@angular/core';
-import { CdkPortalOutlet, ComponentPortal, } from '@angular/cdk/portal';
+import { CdkPortalOutlet, ComponentPortal } from '@angular/cdk/portal';
import { combineLatest } from 'rxjs';
import { distinctUntilChanged, filter } from 'rxjs/operators';
@@ -75,7 +75,8 @@ export class OpModalOverlayComponent {
readonly modalService:OpModalService,
readonly I18n:I18nService,
readonly cdRef:ChangeDetectorRef,
- ) {}
+ ) {
+ }
setupListener():void {
combineLatest([
@@ -100,7 +101,7 @@ export class OpModalOverlayComponent {
});
}
- protected isDefaultTarget(modalData:ModalData | null):boolean {
+ protected isDefaultTarget(modalData:ModalData|null):boolean {
if (modalData === null) return true;
return modalData.target === PortalOutletTarget.Default;
diff --git a/frontend/src/app/shared/components/no-results/no-results.component.ts b/frontend/src/app/shared/components/no-results/no-results.component.ts
index a503d8266de..6998852118e 100644
--- a/frontend/src/app/shared/components/no-results/no-results.component.ts
+++ b/frontend/src/app/shared/components/no-results/no-results.component.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input, } from '@angular/core';
+import { ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input } from '@angular/core';
import { populateInputsFromDataset } from 'core-app/shared/components/dataset-inputs';
diff --git a/frontend/src/app/shared/components/resizer/resizer/main-menu-resizer.component.ts b/frontend/src/app/shared/components/resizer/resizer/main-menu-resizer.component.ts
index afd1c0e3c08..398bc6cf625 100644
--- a/frontend/src/app/shared/components/resizer/resizer/main-menu-resizer.component.ts
+++ b/frontend/src/app/shared/components/resizer/resizer/main-menu-resizer.component.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, OnInit, } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, OnInit } from '@angular/core';
import { distinctUntilChanged } from 'rxjs/operators';
import { ResizeDelta } from 'core-app/shared/components/resizer/resizer.component';
diff --git a/frontend/src/app/shared/components/tabs/content-tabs/content-tabs.component.ts b/frontend/src/app/shared/components/tabs/content-tabs/content-tabs.component.ts
index ab5ce2b9389..dc82ce8e035 100644
--- a/frontend/src/app/shared/components/tabs/content-tabs/content-tabs.component.ts
+++ b/frontend/src/app/shared/components/tabs/content-tabs/content-tabs.component.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Injector, } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Injector } from '@angular/core';
import { GonService } from 'core-app/core/gon/gon.service';
import { StateService } from '@uirouter/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
diff --git a/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts b/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
index 79242faa326..8f8a6b83795 100644
--- a/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
+++ b/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
@@ -1,15 +1,14 @@
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Injector, } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Injector } from '@angular/core';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { TimeEntryEditService } from 'core-app/shared/components/time_entries/edit/edit.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import {
- HalResourceEditingService
+ HalResourceEditingService,
} from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { TimeEntryResource } from 'core-app/features/hal/resources/time-entry-resource';
-import { Observable, switchMap, } from 'rxjs';
-
+import { Observable, switchMap } from 'rxjs';
@Component({
selector: 'opce-time-entry-trigger-actions',
diff --git a/frontend/src/app/shared/components/toaster/toasts-container.component.ts b/frontend/src/app/shared/components/toaster/toasts-container.component.ts
index 6f8492c01e7..f426747f862 100644
--- a/frontend/src/app/shared/components/toaster/toasts-container.component.ts
+++ b/frontend/src/app/shared/components/toaster/toasts-container.component.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { IToast, ToastService } from './toast.service';
@@ -47,7 +47,7 @@ export class ToastsContainerComponent extends UntilDestroyedMixin implements OnI
constructor(
readonly toastService:ToastService,
- readonly cdRef:ChangeDetectorRef
+ readonly cdRef:ChangeDetectorRef,
) {
super();
}
diff --git a/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.component.ts b/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.component.ts
index fa8c996263c..29810504a82 100644
--- a/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.component.ts
+++ b/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.component.ts
@@ -14,7 +14,7 @@ import {
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ChartOptions } from 'chart.js';
import {
- WpGraphConfigurationService
+ WpGraphConfigurationService,
} from 'core-app/shared/components/work-package-graphs/configuration/wp-graph-configuration.service';
import {
WpGraphConfiguration,
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 75b31d9bdff..00be06fa227 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
import { FormsModule } from '@angular/forms';
-import { Injector, NgModule, } from '@angular/core';
+import { Injector, NgModule } from '@angular/core';
import { A11yModule } from '@angular/cdk/a11y';
import { UIRouterGlobals } from '@uirouter/core';
import { NgSelectModule } from '@ng-select/ng-select';
@@ -40,19 +40,19 @@ import { UIRouterModule } from '@uirouter/angular';
import { OpSpotModule } from 'core-app/spot/spot.module';
import { CurrentUserModule } from 'core-app/core/current-user/current-user.module';
import {
- OpenprojectAutocompleterModule
+ OpenprojectAutocompleterModule,
} from 'core-app/shared/components/autocompleter/openproject-autocompleter.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';
import {
- IconTriggeredContextMenuComponent
+ IconTriggeredContextMenuComponent,
} from 'core-app/shared/components/op-context-menu/icon-triggered-context-menu/icon-triggered-context-menu.component';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import {
- SortHeaderDirective
+ SortHeaderDirective,
} from 'core-app/features/work-packages/components/wp-table/sort-header/sort-header.directive';
import {
- ZenModeButtonComponent
+ ZenModeButtonComponent,
} from 'core-app/features/work-packages/components/wp-buttons/zen-mode-toggle-button/zen-mode-toggle-button.component';
import { OPContextMenuComponent } from 'core-app/shared/components/op-context-menu/op-context-menu.component';
import { OpenprojectPrincipalRenderingModule } from 'core-app/shared/components/principal/principal-rendering.module';
@@ -70,7 +70,7 @@ import { ToastComponent } from './components/toaster/toast.component';
// Old datepickers
import {
- OpMultiDatePickerComponent
+ OpMultiDatePickerComponent,
} from 'core-app/shared/components/datepicker/multi-date-picker/multi-date-picker.component';
import { ToastsContainerComponent } from './components/toaster/toasts-container.component';
@@ -81,7 +81,7 @@ import { NoResultsComponent } from './components/no-results/no-results.component
import { EditableToolbarTitleComponent } from './components/editable-toolbar-title/editable-toolbar-title.component';
import { PersistentToggleComponent } from './components/persistent-toggle/persistent-toggle.component';
import {
- AddSectionDropdownComponent
+ 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';
@@ -90,11 +90,11 @@ import { OpProjectIncludeComponent } from './components/project-include/project-
import { OpProjectIncludeListComponent } from './components/project-include/list/project-include-list.component';
import { OpLoadingProjectListComponent } from './components/searchable-project-list/loading-project-list.component';
import {
- OpNonWorkingDaysListComponent
+ OpNonWorkingDaysListComponent,
} from './components/op-non-working-days-list/op-non-working-days-list.component';
import { ViewsResourceService } from 'core-app/core/state/views/views.service';
import {
- OpenprojectContentLoaderModule
+ OpenprojectContentLoaderModule,
} from 'core-app/shared/components/op-content-loader/openproject-content-loader.module';
import { OpenprojectModalModule } from 'core-app/shared/components/modal/modal.module';
import { FullCalendarModule } from '@fullcalendar/angular';
diff --git a/frontend/src/app/spot/components/drop-modal/drop-modal-portal.component.ts b/frontend/src/app/spot/components/drop-modal/drop-modal-portal.component.ts
index 161f10b9b0f..85837d5aa07 100644
--- a/frontend/src/app/spot/components/drop-modal/drop-modal-portal.component.ts
+++ b/frontend/src/app/spot/components/drop-modal/drop-modal-portal.component.ts
@@ -7,7 +7,7 @@ import {
HostBinding,
OnInit,
} from '@angular/core';
-import { SpotDropModalTeleportationService, TeleportInstance, } from './drop-modal-teleportation.service';
+import { SpotDropModalTeleportationService, TeleportInstance } from './drop-modal-teleportation.service';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
diff --git a/frontend/src/app/spot/components/switch/switch.component.ts b/frontend/src/app/spot/components/switch/switch.component.ts
index e3b22e91159..1c7cc5917ee 100644
--- a/frontend/src/app/spot/components/switch/switch.component.ts
+++ b/frontend/src/app/spot/components/switch/switch.component.ts
@@ -16,6 +16,7 @@ import { populateInputsFromDataset } from 'core-app/shared/components/dataset-in
export type SpotSwitchState = boolean;
@Component({
+ // eslint-disable-next-line @angular-eslint/component-selector
selector: 'spot-switch',
templateUrl: './switch.component.html',
providers: [{
@@ -83,9 +84,11 @@ export class SpotSwitchComponent implements ControlValueAccessor {
this.onTouched(value);
}
- onChange = (_:SpotSwitchState):void => {};
+ onChange = (_:SpotSwitchState):void => {
+ };
- onTouched = (_:SpotSwitchState):void => {};
+ onTouched = (_:SpotSwitchState):void => {
+ };
registerOnChange(fn:(_:SpotSwitchState) => void):void {
this.onChange = fn;
diff --git a/frontend/src/stimulus/setup.ts b/frontend/src/stimulus/setup.ts
index de46916e8ac..4844cbd1716 100644
--- a/frontend/src/stimulus/setup.ts
+++ b/frontend/src/stimulus/setup.ts
@@ -6,7 +6,7 @@ import OpDisableWhenCheckedController from './controllers/disable-when-checked.c
import PrintController from './controllers/print.controller';
import RefreshOnFormChangesController from './controllers/refresh-on-form-changes.controller';
import AsyncDialogController from './controllers/async-dialog.controller';
-import TableHighlightingController from "./controllers/table-highlighting.controller";
+import TableHighlightingController from './controllers/table-highlighting.controller';
declare global {
interface Window {
diff --git a/lib/tabular_form_builder.rb b/lib/tabular_form_builder.rb
index 88576b7869c..c36ce2517d0 100644
--- a/lib/tabular_form_builder.rb
+++ b/lib/tabular_form_builder.rb
@@ -83,7 +83,7 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder
super
end
- def date_picker(field, options = {})
+ def date_picker(field, options = {}) # rubocop:disable Metrics/AbcSize
options[:class] = Array(options[:class])
options[:container_class] ||= "-xslim"
merge_required_attributes(options[:required], options)
diff --git a/modules/reporting/app/helpers/reporting_helper.rb b/modules/reporting/app/helpers/reporting_helper.rb
index f7b4b5aaa7b..5bbf61d7424 100644
--- a/modules/reporting/app/helpers/reporting_helper.rb
+++ b/modules/reporting/app/helpers/reporting_helper.rb
@@ -161,13 +161,6 @@ module ReportingHelper
end
end
- def html_safe_gsub(string, *gsub_args, &)
- html_safe = string.html_safe?
- string.gsub(*gsub_args, &)
- # We only mark the string as safe if the previous string was already safe
- string.html_safe if html_safe # rubocop:disable Rails/OutputSafety
- end
-
def show_result(row, unit_id = self.unit_id)
case unit_id
when -1 then l_hours(row.units)
diff --git a/modules/reporting/lib/widget/filters/date.rb b/modules/reporting/lib/widget/filters/date.rb
index c4764876c26..300c23d9ad6 100644
--- a/modules/reporting/lib/widget/filters/date.rb
+++ b/modules/reporting/lib/widget/filters/date.rb
@@ -29,7 +29,7 @@
class Widget::Filters::Date < Widget::Filters::Base
include AngularHelper
- def render
+ def render # rubocop:disable Metrics/AbcSize
@calendar_headers_tags_included = true
name = "values[#{filter_class.underscore_name}][]"