From 53fa7e007c32cae40edecdb52b57b30a75c8a336 Mon Sep 17 00:00:00 2001 From: Elblinator <69210919+Elblinator@users.noreply.github.com> Date: Tue, 14 May 2024 09:06:21 +0200 Subject: [PATCH] Cleanup linter warnings (#3644) --- client/src/app/gateways/actions/action.ts | 2 +- .../src/app/gateways/base-icc-gateway.service.ts | 2 +- .../pdf-document.service/pdf-document.service.ts | 2 +- .../pdf-document.service/pdf-worker.worker.ts | 14 +++++++------- .../presenter/history-presenter.service.ts | 2 +- .../agenda/agenda-item-repository.service.ts | 8 ++++---- .../assignment-candidate-repository.service.ts | 4 ++-- .../assignment-repository.service.ts | 4 ++-- ...d-list-of-speakers-content-object-repository.ts | 12 ++++++------ .../base-agenda-item-content-object-repository.ts | 4 ++-- ...e-list-of-speakers-content-object-repository.ts | 4 ++-- .../base-meeting-related-repository.ts | 3 ++- .../app/gateways/repositories/base-repository.ts | 8 ++++---- .../speaking-times/speaking-times.component.ts | 2 +- .../speaker-user-select-dialog.component.ts | 2 +- .../projectable-list/projectable-list.component.ts | 8 ++++---- .../participant-search-selector.component.ts | 4 ++-- .../modules/poll/base/base-poll-vote.component.ts | 2 +- .../check-input/check-input.component.ts | 2 +- .../single-option-chart-table.component.ts | 2 +- .../poll/services/voting.service/voting.service.ts | 2 +- .../poll-slide/components/poll-slide.component.ts | 2 +- .../topic-poll-detail-content.component.ts | 4 +++- .../topic-poll-dialog.component.ts | 2 +- .../topic-poll-vote/topic-poll-vote.component.ts | 4 ++-- .../topic-detail/topic-detail.component.ts | 2 +- .../agenda-item-multiselect.service.ts | 12 +++++++++--- .../pages/agenda/view-models/view-agenda-item.ts | 7 ++++++- .../history-list/history-list.component.ts | 6 +++--- .../video-player/video-player.component.ts | 2 +- .../mediafile-list/mediafile-list.component.ts | 2 +- .../line-numbering.service.ts | 8 ++++---- .../motion-block-sort.service.ts | 2 +- .../motion-content/motion-content.component.ts | 2 +- .../motion-detail-view.component.ts | 4 ++-- .../motion-manage-title.component.ts | 2 +- .../motion-meta-data/motion-meta-data.component.ts | 2 +- .../motion-detail-view-originurl.service.ts | 2 +- 38 files changed, 86 insertions(+), 72 deletions(-) diff --git a/client/src/app/gateways/actions/action.ts b/client/src/app/gateways/actions/action.ts index 4422ca46dd..6c9cebad6e 100644 --- a/client/src/app/gateways/actions/action.ts +++ b/client/src/app/gateways/actions/action.ts @@ -58,4 +58,4 @@ export class Action { } } -export const createEmptyAction = () => new Action(async () => []); +export const createEmptyAction = (): Action => new Action(async () => []); diff --git a/client/src/app/gateways/base-icc-gateway.service.ts b/client/src/app/gateways/base-icc-gateway.service.ts index 049b3db314..53fd038d95 100644 --- a/client/src/app/gateways/base-icc-gateway.service.ts +++ b/client/src/app/gateways/base-icc-gateway.service.ts @@ -72,7 +72,7 @@ export abstract class BaseICCGatewayService { msgSub.unsubscribe(); onClosedSub.unsubscribe(); }); - this.connectionClosingFn = () => { + this.connectionClosingFn = (): void => { onReastartSub.unsubscribe(); msgSub.unsubscribe(); onClosedSub.unsubscribe(); diff --git a/client/src/app/gateways/export/pdf-document.service/pdf-document.service.ts b/client/src/app/gateways/export/pdf-document.service/pdf-document.service.ts index 0ae2b5b4f7..b5d6889a82 100644 --- a/client/src/app/gateways/export/pdf-document.service/pdf-document.service.ts +++ b/client/src/app/gateways/export/pdf-document.service/pdf-document.service.ts @@ -202,7 +202,7 @@ class PdfCreator { }); // the result of the worker - this._pdfWorker.onmessage = ({ data }) => { + this._pdfWorker.onmessage = ({ data }): void => { // if the worker returns a numbers, is always the progress if (typeof data === `number`) { // update progress diff --git a/client/src/app/gateways/export/pdf-document.service/pdf-worker.worker.ts b/client/src/app/gateways/export/pdf-document.service/pdf-worker.worker.ts index 1cc0e04068..0f0cfa146f 100644 --- a/client/src/app/gateways/export/pdf-document.service/pdf-worker.worker.ts +++ b/client/src/app/gateways/export/pdf-document.service/pdf-worker.worker.ts @@ -4,15 +4,15 @@ import * as pdfMake from 'pdfmake/build/pdfmake'; const osTableLayout = { switchColorTableLayout: { - hLineWidth: (rowIndex: any) => rowIndex === 1, - vLineWidth: () => 0, - fillColor: (rowIndex: any) => (rowIndex % 2 === 0 ? `#EEEEEE` : null) + hLineWidth: (rowIndex: any): boolean => rowIndex === 1, + vLineWidth: (): number => 0, + fillColor: (rowIndex: any): string => (rowIndex % 2 === 0 ? `#EEEEEE` : null) }, metaboxLayout: { - fillColor: () => `#dddddd`, - hLineWidth: (i: any, node: any) => (i === 0 || i === node.table.body.length ? 0 : 0.5), - vLineWidth: () => 0, - hLineColor: () => `white` + fillColor: (): string => `#dddddd`, + hLineWidth: (i: any, node: any): 0 | 0.5 => (i === 0 || i === node.table.body.length ? 0 : 0.5), + vLineWidth: (): number => 0, + hLineColor: (): string => `white` } }; diff --git a/client/src/app/gateways/presenter/history-presenter.service.ts b/client/src/app/gateways/presenter/history-presenter.service.ts index e1dd42feb3..69ea7769ce 100644 --- a/client/src/app/gateways/presenter/history-presenter.service.ts +++ b/client/src/app/gateways/presenter/history-presenter.service.ts @@ -48,7 +48,7 @@ interface HistoryPresenterResponse { const HISTORY_ENDPOINT = `/system/autoupdate/history_information`; -const getUniqueItems = (positions: Position[]) => { +const getUniqueItems = (positions: Position[]): Position[] => { const positionMap: { [positionNumber: number]: Position } = {}; for (const position of positions) { positionMap[position.position] = position; diff --git a/client/src/app/gateways/repositories/agenda/agenda-item-repository.service.ts b/client/src/app/gateways/repositories/agenda/agenda-item-repository.service.ts index 555bfcd65a..486b31739f 100644 --- a/client/src/app/gateways/repositories/agenda/agenda-item-repository.service.ts +++ b/client/src/app/gateways/repositories/agenda/agenda-item-repository.service.ts @@ -25,7 +25,7 @@ export class AgendaItemRepositoryService extends BaseMeetingRelatedRepository a.tree_weight - b.tree_weight); // leave the sorting as it is } - public getVerboseName = (plural = false) => this.translate.instant(plural ? `Items` : `Item`); + public getVerboseName = (plural = false): string => this.translate.instant(plural ? `Items` : `Item`); private getAgendaTitle(viewAgendaItem: ViewAgendaItem): AgendaListTitle { if (viewAgendaItem.content_object) { @@ -36,9 +36,9 @@ export class AgendaItemRepositoryService extends BaseMeetingRelatedRepository this.getAgendaTitle(viewAgendaItem).title; + public getTitle = (viewAgendaItem: ViewAgendaItem): string => this.getAgendaTitle(viewAgendaItem).title; - public getSubtitle = (viewAgendaItem: ViewAgendaItem) => this.getAgendaTitle(viewAgendaItem).subtitle; + public getSubtitle = (viewAgendaItem: ViewAgendaItem): string => this.getAgendaTitle(viewAgendaItem).subtitle; public getItemNumberPrefix(viewModel: HasAgendaItem): string { return viewModel.agenda_item && viewModel.agenda_item.item_number @@ -128,7 +128,7 @@ export class AgendaItemRepositoryService extends BaseMeetingRelatedRepository this.getSubtitle(viewModel) as string; + viewModel.getSubtitle = (): string => this.getSubtitle(viewModel) as string; return viewModel; } diff --git a/client/src/app/gateways/repositories/assignments/assignment-candidate-repository.service/assignment-candidate-repository.service.ts b/client/src/app/gateways/repositories/assignments/assignment-candidate-repository.service/assignment-candidate-repository.service.ts index 848b7cbdaa..f82507a5ea 100644 --- a/client/src/app/gateways/repositories/assignments/assignment-candidate-repository.service/assignment-candidate-repository.service.ts +++ b/client/src/app/gateways/repositories/assignments/assignment-candidate-repository.service/assignment-candidate-repository.service.ts @@ -21,10 +21,10 @@ export class AssignmentCandidateRepositoryService extends BaseMeetingRelatedRepo super(repositoryServiceCollector, AssignmentCandidate); } - public getTitle = (viewAssignmentCandidate: ViewAssignmentCandidate) => + public getTitle = (viewAssignmentCandidate: ViewAssignmentCandidate): string => viewAssignmentCandidate.user?.getTitle() ?? UnknownUserLabel; - public getVerboseName = (plural = false) => this.translate.instant(plural ? `Candidates` : `Candidate`); + public getVerboseName = (plural = false): string => this.translate.instant(plural ? `Candidates` : `Candidate`); public async create(assignment: Identifiable, meetingUserId: Id): Promise { const payload = { diff --git a/client/src/app/gateways/repositories/assignments/assignment-repository.service/assignment-repository.service.ts b/client/src/app/gateways/repositories/assignments/assignment-repository.service/assignment-repository.service.ts index 2723adda1d..803d669a9e 100644 --- a/client/src/app/gateways/repositories/assignments/assignment-repository.service/assignment-repository.service.ts +++ b/client/src/app/gateways/repositories/assignments/assignment-repository.service/assignment-repository.service.ts @@ -58,9 +58,9 @@ export class AssignmentRepositoryService extends BaseAgendaItemAndListOfSpeakers return this.sendBulkActionToBackend(AssignmentAction.DELETE, payload); } - public getTitle = (viewAssignment: ViewAssignment) => viewAssignment.title; + public getTitle = (viewAssignment: ViewAssignment): string => viewAssignment.title; - public getVerboseName = (plural = false) => this.translate.instant(plural ? `Elections` : `Election`); + public getVerboseName = (plural = false): string => this.translate.instant(plural ? `Elections` : `Election`); private getPartialPayload(model: Partial): any { return { diff --git a/client/src/app/gateways/repositories/base-agenda-item-and-list-of-speakers-content-object-repository.ts b/client/src/app/gateways/repositories/base-agenda-item-and-list-of-speakers-content-object-repository.ts index c07fc0933d..12c366edee 100644 --- a/client/src/app/gateways/repositories/base-agenda-item-and-list-of-speakers-content-object-repository.ts +++ b/client/src/app/gateways/repositories/base-agenda-item-and-list-of-speakers-content-object-repository.ts @@ -37,16 +37,16 @@ export abstract class BaseAgendaItemAndListOfSpeakersContentObjectRepository< return numberPrefix + this.getTitle(viewModel); } - public getListOfSpeakersTitle = (viewModel: V) => this.getAgendaListTitle(viewModel).title; + public getListOfSpeakersTitle = (viewModel: V): string => this.getAgendaListTitle(viewModel).title; - public getListOfSpeakersSlideTitle = (viewModel: V) => this.getAgendaSlideTitle(viewModel); + public getListOfSpeakersSlideTitle = (viewModel: V): string => this.getAgendaSlideTitle(viewModel); protected override createViewModel(model: M): V { const viewModel = super.createViewModel(model); - viewModel.getAgendaListTitle = () => this.getAgendaListTitle(viewModel); - viewModel.getAgendaSlideTitle = () => this.getAgendaSlideTitle(viewModel); - viewModel.getListOfSpeakersTitle = () => this.getListOfSpeakersTitle(viewModel); - viewModel.getListOfSpeakersSlideTitle = () => this.getListOfSpeakersSlideTitle(viewModel); + viewModel.getAgendaListTitle = (): AgendaListTitle => this.getAgendaListTitle(viewModel); + viewModel.getAgendaSlideTitle = (): string => this.getAgendaSlideTitle(viewModel); + viewModel.getListOfSpeakersTitle = (): string => this.getListOfSpeakersTitle(viewModel); + viewModel.getListOfSpeakersSlideTitle = (): string => this.getListOfSpeakersSlideTitle(viewModel); return viewModel; } } diff --git a/client/src/app/gateways/repositories/base-agenda-item-content-object-repository.ts b/client/src/app/gateways/repositories/base-agenda-item-content-object-repository.ts index 5bfd38af40..4193dbc67e 100644 --- a/client/src/app/gateways/repositories/base-agenda-item-content-object-repository.ts +++ b/client/src/app/gateways/repositories/base-agenda-item-content-object-repository.ts @@ -64,8 +64,8 @@ export abstract class BaseAgendaItemContentObjectRepository< */ protected override createViewModel(model: M): V { const viewModel = super.createViewModel(model); - viewModel.getAgendaListTitle = () => this.getAgendaListTitle(viewModel); - viewModel.getAgendaSlideTitle = () => this.getAgendaSlideTitle(viewModel); + viewModel.getAgendaListTitle = (): AgendaListTitle => this.getAgendaListTitle(viewModel); + viewModel.getAgendaSlideTitle = (): string => this.getAgendaSlideTitle(viewModel); return viewModel; } } diff --git a/client/src/app/gateways/repositories/base-list-of-speakers-content-object-repository.ts b/client/src/app/gateways/repositories/base-list-of-speakers-content-object-repository.ts index dcb02ddbd6..4cfcd038ef 100644 --- a/client/src/app/gateways/repositories/base-list-of-speakers-content-object-repository.ts +++ b/client/src/app/gateways/repositories/base-list-of-speakers-content-object-repository.ts @@ -47,8 +47,8 @@ export abstract class BaseListOfSpeakersContentObjectRepository< */ protected override createViewModel(model: M): V { const viewModel = super.createViewModel(model); - viewModel.getListOfSpeakersTitle = () => this.getListOfSpeakersTitle(viewModel); - viewModel.getListOfSpeakersSlideTitle = () => this.getListOfSpeakersSlideTitle(viewModel); + viewModel.getListOfSpeakersTitle = (): string => this.getListOfSpeakersTitle(viewModel); + viewModel.getListOfSpeakersSlideTitle = (): string => this.getListOfSpeakersSlideTitle(viewModel); return viewModel; } } diff --git a/client/src/app/gateways/repositories/base-meeting-related-repository.ts b/client/src/app/gateways/repositories/base-meeting-related-repository.ts index 4312389cf7..79d9e7f741 100644 --- a/client/src/app/gateways/repositories/base-meeting-related-repository.ts +++ b/client/src/app/gateways/repositories/base-meeting-related-repository.ts @@ -55,7 +55,8 @@ export abstract class BaseMeetingRelatedRepository this.repositoryMeetingServiceCollector.activeMeetingIdService.meetingId; + viewModel.getActiveMeetingId = (): number => + this.repositoryMeetingServiceCollector.activeMeetingIdService.meetingId; return viewModel; } } diff --git a/client/src/app/gateways/repositories/base-repository.ts b/client/src/app/gateways/repositories/base-repository.ts index e63c63bcbf..6d27313b8d 100644 --- a/client/src/app/gateways/repositories/base-repository.ts +++ b/client/src/app/gateways/repositories/base-repository.ts @@ -501,8 +501,8 @@ export abstract class BaseRepository this.getTitle(viewModel); - viewModel.getListTitle = () => this.getListTitle(viewModel); + viewModel.getTitle = (): string => this.getTitle(viewModel); + viewModel.getListTitle = (): string => this.getListTitle(viewModel); viewModel.getVerboseName = this.getVerboseName; this.onCreateViewModel(viewModel); @@ -588,7 +588,7 @@ export abstract class BaseRepository { + funct: async (): Promise => { const sortListService = this.sortListServices[key]; this.updateForeignBaseKeys(key); await sortListService.hasLoaded; @@ -612,7 +612,7 @@ export abstract class BaseRepository keys.includes(key))) { this.sortedViewModelLists[key] = await sortListService.sort(this.sortedViewModelLists[key]); const resortAction = { - funct: async () => { + funct: async (): Promise => { this.sortedViewModelLists[key] = await sortListService.sort(this.sortedViewModelLists[key]); }, type: PipelineActionType.Resort, diff --git a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/speaking-times/speaking-times.component.ts b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/speaking-times/speaking-times.component.ts index ca7f6123a9..76428176af 100644 --- a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/speaking-times/speaking-times.component.ts +++ b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/speaking-times/speaking-times.component.ts @@ -228,7 +228,7 @@ export class SpeakingTimesComponent implements OnDestroy { } } - private updateSpeakingTime(speakingTime: ViewStructureLevelListOfSpeakers) { + private updateSpeakingTime(speakingTime: ViewStructureLevelListOfSpeakers): void { if (speakingTime) { if (speakingTime.isInactive) { this.structureLevels.delete(speakingTime.id); diff --git a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/modules/speaker-user-select-dialog/components/speaker-user-select-dialog/speaker-user-select-dialog.component.ts b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/modules/speaker-user-select-dialog/components/speaker-user-select-dialog/speaker-user-select-dialog.component.ts index 62968953a5..c06fbded45 100644 --- a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/modules/speaker-user-select-dialog/components/speaker-user-select-dialog/speaker-user-select-dialog.component.ts +++ b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/modules/speaker-user-select-dialog/components/speaker-user-select-dialog/speaker-user-select-dialog.component.ts @@ -25,7 +25,7 @@ export class SpeakerUserSelectDialogComponent { public userRepo: UserRepositoryService ) {} - public setCurrentUser(selection: UserSelectionData) { + public setCurrentUser(selection: UserSelectionData): void { if (selection.userId) { const meeting_user = this.userRepo .getViewModel(selection.userId) diff --git a/client/src/app/site/pages/meetings/modules/meetings-component-collector/projectable-list/components/projectable-list/projectable-list.component.ts b/client/src/app/site/pages/meetings/modules/meetings-component-collector/projectable-list/components/projectable-list/projectable-list.component.ts index 3dfdd72278..95b44fb8e1 100644 --- a/client/src/app/site/pages/meetings/modules/meetings-component-collector/projectable-list/components/projectable-list/projectable-list.component.ts +++ b/client/src/app/site/pages/meetings/modules/meetings-component-collector/projectable-list/components/projectable-list/projectable-list.component.ts @@ -49,12 +49,12 @@ export class ProjectableListComponent BaseViewModel & HasListOfSpeakers) | null = null; @Input() - public override toRestrictFn = (restriction: ColumnRestriction) => + public override toRestrictFn = (restriction: ColumnRestriction): boolean => !this.operator.hasPerms(restriction.permission); @Input() - public override toHideFn = () => { - const columnsToHide = []; + public override toHideFn = (): string[] => { + let columnsToHide: string[]; // hide the projector columns if (this.multiSelect || this.isMobile || !this.allowProjector) { @@ -90,7 +90,7 @@ export class ProjectableListComponent + public readonly isProjectedFn = (model: BaseProjectableViewModel): boolean => this.service.isProjectedOnReferenceProjector(model); public constructor( diff --git a/client/src/app/site/pages/meetings/modules/participant-search-selector/components/participant-search-selector/participant-search-selector.component.ts b/client/src/app/site/pages/meetings/modules/participant-search-selector/components/participant-search-selector/participant-search-selector.component.ts index ded1bf213e..6e9dd2155a 100644 --- a/client/src/app/site/pages/meetings/modules/participant-search-selector/components/participant-search-selector/participant-search-selector.component.ts +++ b/client/src/app/site/pages/meetings/modules/participant-search-selector/components/participant-search-selector/participant-search-selector.component.ts @@ -131,7 +131,7 @@ export class ParticipantSearchSelectorComponent extends BaseUiComponent implemen /** * This function ensures that a selected user is quickly removed from the selection list */ - private removeUserFromSelectorList(userId: number) { + private removeUserFromSelectorList(userId: number): void { this._filteredUsersSubject.next( this._filteredUsersSubject.value.filter(user => { return user.id !== userId; @@ -143,7 +143,7 @@ export class ParticipantSearchSelectorComponent extends BaseUiComponent implemen * Sets the current value of the filteredUsersSubject to an Array that holds exactly every single user, * who should be available for selection (i.e. who is not included in nonSelectableUsersSubject.value) */ - private filterUsers() { + private filterUsers(): void { const notAvailable = this._nonSelectableUserIds; const availableUsers = this._users.filter(user => !notAvailable.includes(user.id)); this._filteredUsersSubject.next(availableUsers); diff --git a/client/src/app/site/pages/meetings/modules/poll/base/base-poll-vote.component.ts b/client/src/app/site/pages/meetings/modules/poll/base/base-poll-vote.component.ts index 60a2d7cb24..4f140bd34e 100644 --- a/client/src/app/site/pages/meetings/modules/poll/base/base-poll-vote.component.ts +++ b/client/src/app/site/pages/meetings/modules/poll/base/base-poll-vote.component.ts @@ -112,7 +112,7 @@ export abstract class BasePollVoteComponent e return this.votingService.getVotingProhibitionReasonVerbose(this.poll, user) || ``; } - public getVotingErrorFromName(errorName: string) { + public getVotingErrorFromName(errorName: string): string { return this.votingService.getVotingProhibitionReasonVerboseFromName(errorName) || ``; } diff --git a/client/src/app/site/pages/meetings/modules/poll/components/check-input/check-input.component.ts b/client/src/app/site/pages/meetings/modules/poll/components/check-input/check-input.component.ts index 039f3d6786..9de886b691 100644 --- a/client/src/app/site/pages/meetings/modules/poll/components/check-input/check-input.component.ts +++ b/client/src/app/site/pages/meetings/modules/poll/components/check-input/check-input.component.ts @@ -134,7 +134,7 @@ export class CheckInputComponent extends BaseUiComponent implements OnInit, Cont /** * Helper function to determine which information to give to the parent form */ - private propagateChange = (_: any) => {}; + private propagateChange = (_: any): void => {}; /** * Initially build the form-control. diff --git a/client/src/app/site/pages/meetings/modules/poll/components/single-option-chart-table/single-option-chart-table.component.ts b/client/src/app/site/pages/meetings/modules/poll/components/single-option-chart-table/single-option-chart-table.component.ts index fc98d2b18d..a4b0a2b387 100644 --- a/client/src/app/site/pages/meetings/modules/poll/components/single-option-chart-table/single-option-chart-table.component.ts +++ b/client/src/app/site/pages/meetings/modules/poll/components/single-option-chart-table/single-option-chart-table.component.ts @@ -41,7 +41,7 @@ export class SingleOptionChartTableComponent { this.cd.markForCheck(); } - public get pollService() { + public get pollService(): PollService { return this._pollService || this.defaultPollService; } diff --git a/client/src/app/site/pages/meetings/modules/poll/services/voting.service/voting.service.ts b/client/src/app/site/pages/meetings/modules/poll/services/voting.service/voting.service.ts index 51cb735412..5282d42dcc 100644 --- a/client/src/app/site/pages/meetings/modules/poll/services/voting.service/voting.service.ts +++ b/client/src/app/site/pages/meetings/modules/poll/services/voting.service/voting.service.ts @@ -105,7 +105,7 @@ export class VotingService { } } - public getVotingProhibitionReasonVerboseFromName(reasonName: string) { + public getVotingProhibitionReasonVerboseFromName(reasonName: string): string { return VotingProhibitionVerbose[VotingProhibition[reasonName]] ?? _(`There is an unknown voting problem.`); } } diff --git a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/poll-slide/components/poll-slide.component.ts b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/poll-slide/components/poll-slide.component.ts index fec9fc3ee6..e8b6c03cb0 100644 --- a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/poll-slide/components/poll-slide.component.ts +++ b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/poll-slide/components/poll-slide.component.ts @@ -86,7 +86,7 @@ export class PollSlideComponent extends BaseSlideComponent { } private createPollData(data: PollSlideData): PollData { - const getContentObjectTitle = () => { + const getContentObjectTitle = (): string => { if (data.title_information) { modifyAgendaItemNumber(data.title_information); const repo = this.collectionMapperService.getRepository(data.title_information.collection); diff --git a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-detail-content/topic-poll-detail-content.component.ts b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-detail-content/topic-poll-detail-content.component.ts index 16b8803b14..3af480497b 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-detail-content/topic-poll-detail-content.component.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-detail-content/topic-poll-detail-content.component.ts @@ -28,7 +28,9 @@ export class TopicPollDetailContentComponent extends BaseUiComponent { return this._tableData; } - public get colors() { + public get colors(): { + backgroundColor: string[]; + } { return this.chartColors[0]; } diff --git a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-dialog/topic-poll-dialog.component.ts b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-dialog/topic-poll-dialog.component.ts index 47025adf4f..a26f8b3b10 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-dialog/topic-poll-dialog.component.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-dialog/topic-poll-dialog.component.ts @@ -88,7 +88,7 @@ export class TopicPollDialogComponent extends BasePollDialogComponent implements this.optionTypeText = true; } - public ngAfterViewInit() { + public ngAfterViewInit(): void { if (this.scrollFrame) { this.scrollContainer = this.scrollFrame.nativeElement; this.itemElements.changes.subscribe(_ => this.onItemElementsChanged()); diff --git a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-vote/topic-poll-vote.component.ts b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-vote/topic-poll-vote.component.ts index c9a9d844ad..71c89bf87c 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-vote/topic-poll-vote.component.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/modules/topic-poll/components/topic-poll-vote/topic-poll-vote.component.ts @@ -231,7 +231,7 @@ export class TopicPollVoteComponent extends BasePollVoteComponent imp this.handleVotingMethodYOrN(maxVotesAmount, tmpVoteRequest, user); } - public handleVotingMethodYOrN(maxVotesAmount: number, tmpVoteRequest: any, user: ViewUser = this.user) { + public handleVotingMethodYOrN(maxVotesAmount: number, tmpVoteRequest: any, user: ViewUser = this.user): void { // check if you can still vote const countedVotes = Object.keys(tmpVoteRequest).filter(key => tmpVoteRequest[key]).length; if (countedVotes <= maxVotesAmount) { @@ -347,7 +347,7 @@ export class TopicPollVoteComponent extends BasePollVoteComponent imp } } - protected override updatePoll() { + protected override updatePoll(): void { super.updatePoll(); this.defineVoteOptions(); } diff --git a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts index 7706402438..486474e070 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts @@ -77,7 +77,7 @@ export class TopicDetailComponent extends BaseMeetingComponent implements OnInit private _topicId: Id | null = null; - public getTitleFn = () => this.topic.getListTitle(); + public getTitleFn = (): string => this.topic.getListTitle(); public get showNavigateButtons(): boolean { return this.enableNavigation && (!!this.previousTopic || !!this.nextTopic); diff --git a/client/src/app/site/pages/meetings/pages/agenda/pages/agenda-item-list/services/agenda-item-multiselect.service/agenda-item-multiselect.service.ts b/client/src/app/site/pages/meetings/pages/agenda/pages/agenda-item-list/services/agenda-item-multiselect.service/agenda-item-multiselect.service.ts index 195b59f0c5..6d603bf190 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/pages/agenda-item-list/services/agenda-item-multiselect.service/agenda-item-multiselect.service.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/pages/agenda-item-list/services/agenda-item-multiselect.service/agenda-item-multiselect.service.ts @@ -65,14 +65,20 @@ export class AgendaItemMultiselectService { } } - private async addTags(agendaItems: ViewAgendaItem[], selectedChoice: ChoiceAnswer) { + private async addTags( + agendaItems: ViewAgendaItem[], + selectedChoice: ChoiceAnswer + ): Promise[]> { return agendaItems.map(agendaItem => { const tagIds = new Set((agendaItem.tag_ids || []).concat(selectedChoice.ids)); return this.repo.update({ tag_ids: Array.from(tagIds) }, agendaItem); }); } - private async removeTags(agendaItems: ViewAgendaItem[], selectedChoice: ChoiceAnswer) { + private async removeTags( + agendaItems: ViewAgendaItem[], + selectedChoice: ChoiceAnswer + ): Promise[]> { return agendaItems.map(agendaItem => { const remainingTagIds = new Set( agendaItem.tag_ids.filter(tagId => selectedChoice.ids.indexOf(tagId) === -1) @@ -81,7 +87,7 @@ export class AgendaItemMultiselectService { }); } - private async clearTags(agendaItems: ViewAgendaItem[]) { + private async clearTags(agendaItems: ViewAgendaItem[]): Promise[]> { return agendaItems.map(agendaItem => this.repo.update({ tag_ids: [] }, agendaItem)); } } diff --git a/client/src/app/site/pages/meetings/pages/agenda/view-models/view-agenda-item.ts b/client/src/app/site/pages/meetings/pages/agenda/view-models/view-agenda-item.ts index 7b13a88e05..77a453aa10 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/view-models/view-agenda-item.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/view-models/view-agenda-item.ts @@ -33,7 +33,12 @@ export class ViewAgendaItem extends BaseProjectableViewModel { return type ? type.name : ``; } - public override getProjectorTitle = (_projection: Projection) => { + public override getProjectorTitle = ( + _projection: Projection + ): { + title: string; + subtitle: string; + } => { const subtitle = this.item.comment || undefined; return { title: this.getTitle(), subtitle }; }; diff --git a/client/src/app/site/pages/meetings/pages/history/components/history-list/history-list.component.ts b/client/src/app/site/pages/meetings/pages/history/components/history-list/history-list.component.ts index f87109232b..863d9c0a21 100644 --- a/client/src/app/site/pages/meetings/pages/history/components/history-list/history-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/history/components/history-list/history-list.component.ts @@ -146,7 +146,7 @@ export class HistoryListComponent extends BaseMeetingComponent implements OnInit public ngOnInit(): void { super.setTitle(`History`); - this.dataSource.filterPredicate = (position: HistoryPosition, filter: string) => { + this.dataSource.filterPredicate = (position: HistoryPosition, filter: string): boolean => { filter = filter ? filter.toLowerCase() : ``; if (!position) { @@ -351,8 +351,8 @@ export class HistoryListComponent extends BaseMeetingComponent implements OnInit meeting_id: this.activeMeeting.id }); Object.values(result).forEach(model => { - model.getTitle = () => this.modelsRepoMap[this.currentCollection].getTitle(model); - model.getListTitle = () => this.modelsRepoMap[this.currentCollection].getListTitle(model); + model.getTitle = (): string => this.modelsRepoMap[this.currentCollection].getTitle(model); + model.getListTitle = (): string => this.modelsRepoMap[this.currentCollection].getListTitle(model); }); this.models = Object.values(result); } diff --git a/client/src/app/site/pages/meetings/pages/interaction/modules/interaction-container/components/video-player/video-player.component.ts b/client/src/app/site/pages/meetings/pages/interaction/modules/interaction-container/components/video-player/video-player.component.ts index c4fc9cc46b..1cc6437069 100644 --- a/client/src/app/site/pages/meetings/pages/interaction/modules/interaction-container/components/video-player/video-player.component.ts +++ b/client/src/app/site/pages/meetings/pages/interaction/modules/interaction-container/components/video-player/video-player.component.ts @@ -245,7 +245,7 @@ export class VideoPlayerComponent implements AfterViewInit, OnDestroy { const script = document.createElement(`script`); script.type = `text/javascript`; script.src = `https://demo.nanocosmos.de/nanoplayer/api/release/nanoplayer.4.min.js`; - script.onload = () => { + script.onload = (): void => { // @ts-ignore this.nanoPlayer = new NanoPlayer(`nanocosmosPlayer`); resolve(); diff --git a/client/src/app/site/pages/meetings/pages/mediafiles/modules/mediafile-list/components/mediafile-list/mediafile-list.component.ts b/client/src/app/site/pages/meetings/pages/mediafiles/modules/mediafile-list/components/mediafile-list/mediafile-list.component.ts index 9ac6d8e79a..c90c4f2877 100644 --- a/client/src/app/site/pages/meetings/pages/mediafiles/modules/mediafile-list/components/mediafile-list/mediafile-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/mediafiles/modules/mediafile-list/components/mediafile-list/mediafile-list.component.ts @@ -54,7 +54,7 @@ export class MediafileListComponent extends BaseMeetingListViewComponent; - public sortFn = (groupA: ViewGroup, groupB: ViewGroup) => groupA.weight - groupB.weight; + public sortFn = (groupA: ViewGroup, groupB: ViewGroup): number => groupA.weight - groupB.weight; /** * @return true if the user can manage media files diff --git a/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/line-numbering.service/line-numbering.service.ts b/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/line-numbering.service/line-numbering.service.ts index fd963aaf5d..2eecae47a2 100644 --- a/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/line-numbering.service/line-numbering.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/line-numbering.service/line-numbering.service.ts @@ -480,8 +480,8 @@ export class LineNumberingService { let currLineStart = 0; let i = 0; let firstTextNode = true; - const addLine = (text: string) => { - let lineNode; + const addLine = (text: string): HTMLSpanElement | Text => { + let lineNode: HTMLSpanElement | Text; if (firstTextNode) { if (highlight === (this.currentLineNumber as number) - 1) { lineNode = document.createElement(`span`); @@ -511,7 +511,7 @@ export class LineNumberingService { out.push(lineNode); return lineNode; }; - const addLinebreakToPreviousNode = (lineNode: Element, offset: number) => { + const addLinebreakToPreviousNode = (lineNode: Element, offset: number): void => { const firstText = lineNode.nodeValue!.substr(0, offset + 1); const secondText = lineNode.nodeValue!.substr(offset + 1); const lineBreak = this.createLineBreak(); @@ -938,7 +938,7 @@ export class LineNumberingService { * @param {Element} lineNumber */ private splitInlineElementsAtLineBreak(lineNumber: Element): void { - const parentIsInline = (el: Element) => isInlineElement(el.parentElement!); + const parentIsInline = (el: Element): boolean => isInlineElement(el.parentElement!); while (parentIsInline(lineNumber)) { const parent: Element = lineNumber.parentElement as Element; const beforeParent: Element = parent.cloneNode(false); diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-blocks/services/motion-block-sort.service/motion-block-sort.service.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-blocks/services/motion-block-sort.service/motion-block-sort.service.ts index fbd425eb5c..e4332e68ab 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-blocks/services/motion-block-sort.service/motion-block-sort.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-blocks/services/motion-block-sort.service/motion-block-sort.service.ts @@ -20,7 +20,7 @@ export class MotionBlockSortService extends BaseSortListService { property: `motions`, label: `Amount of motions`, - sortFn: (aBlock, bBlock, ascending) => + sortFn: (aBlock, bBlock, ascending): number => ascending ? aBlock.motions.length - bBlock.motions.length : bBlock.motions.length - aBlock.motions.length, diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-content/motion-content.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-content/motion-content.component.ts index c7d2cc90f5..9039beb729 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-content/motion-content.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-content/motion-content.component.ts @@ -420,7 +420,7 @@ export class MotionContentComponent extends BaseMotionDetailChildComponent { this.updateMotionNumbersSubject(); } - private updateMotionNumbersSubject(motions?: ViewMotion[]) { + private updateMotionNumbersSubject(motions?: ViewMotion[]): void { this._motionNumbersSubject.next( (motions ?? this.motionController.getViewModelList()) .filter( diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-view/motion-detail-view.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-view/motion-detail-view.component.ts index 13ff98cc9f..95ac10dd87 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-view/motion-detail-view.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-view/motion-detail-view.component.ts @@ -203,7 +203,7 @@ export class MotionDetailViewComponent extends BaseMeetingComponent implements O * Sets @var this._navigatedFromAmendmentList on navigation from either of both lists. * Does nothing on navigation between two motions. */ - private isNavigatedFromAmendments() { + private isNavigatedFromAmendments(): void { const previousUrl = this.originUrlService.getPreviousUrl(); if (!!previousUrl) { if (previousUrl.endsWith(`amendments`)) { @@ -338,7 +338,7 @@ export class MotionDetailViewComponent extends BaseMeetingComponent implements O * @param indexOfCurrent The index from the active motion. * @param step Stepwidth to iterate eiter over the previous or next motions. */ - private findNextSuitableMotion(indexOfCurrent: number, step: number) { + private findNextSuitableMotion(indexOfCurrent: number, step: number): ViewMotion { if (!this._amendmentsInMainList || !this._navigatedFromAmendmentList) { return this._sortedMotions[indexOfCurrent + step]; } diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-manage-title/motion-manage-title.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-manage-title/motion-manage-title.component.ts index 0a1198f1d8..6db095ee96 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-manage-title/motion-manage-title.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-manage-title/motion-manage-title.component.ts @@ -25,7 +25,7 @@ export class MotionManageTitleComponent extends BaseMotionDetailChildComponent { return this.motion.lead_motion!; } - public getTitleFn = () => this.getTitleWithChanges(); + public getTitleFn = (): string => this.getTitleWithChanges(); private get personalNote(): PersonalNote | null { return this.motion.getPersonalNote(); diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-meta-data/motion-meta-data.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-meta-data/motion-meta-data.component.ts index 14dd9dcfa6..58c984397d 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-meta-data/motion-meta-data.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-meta-data/motion-meta-data.component.ts @@ -84,7 +84,7 @@ export class MotionMetaDataComponent extends BaseMotionDetailChildComponent impl } ]; - public motionTransformFn = (value: ViewMotion) => `[${value.fqid}]`; + public motionTransformFn = (value: ViewMotion): string => `[${value.fqid}]`; /** * All amendments to this motion diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/services/motion-detail-view-originurl.service/motion-detail-view-originurl.service.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/services/motion-detail-view-originurl.service/motion-detail-view-originurl.service.ts index 0540339b1f..70fc45e4a4 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/services/motion-detail-view-originurl.service/motion-detail-view-originurl.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/services/motion-detail-view-originurl.service/motion-detail-view-originurl.service.ts @@ -21,7 +21,7 @@ export class MotionDetailViewOriginUrlService { }); } - public getPreviousUrl() { + public getPreviousUrl(): string { return this.previousUrl; } }