From 3ac553b4ad64c2edbef600a45c1473a5fab8aef3 Mon Sep 17 00:00:00 2001 From: Elblinator Date: Fri, 3 May 2024 14:44:25 +0200 Subject: [PATCH 1/5] remove deprecated and exchange it with correct function --- .../meetings/base/base-meeting-list-view.component.ts | 7 ------- .../app/site/pages/meetings/base/base-meeting.component.ts | 7 ------- .../list-of-speakers-content.component.ts | 2 +- .../list-of-speakers-entry.component.ts | 2 +- .../assignment-poll-form/assignment-poll-form.component.ts | 2 +- .../home/pages/start/components/start/start.component.ts | 2 +- .../components/motion-content/motion-content.component.ts | 2 +- .../motion-detail-view/motion-detail-view.component.ts | 4 ++-- .../participant-speaker-list.component.ts | 2 +- 9 files changed, 8 insertions(+), 22 deletions(-) diff --git a/client/src/app/site/pages/meetings/base/base-meeting-list-view.component.ts b/client/src/app/site/pages/meetings/base/base-meeting-list-view.component.ts index 73ce9d1bb9..b487cb6cc6 100644 --- a/client/src/app/site/pages/meetings/base/base-meeting-list-view.component.ts +++ b/client/src/app/site/pages/meetings/base/base-meeting-list-view.component.ts @@ -20,13 +20,6 @@ export abstract class BaseMeetingListViewComponent exte return this.activeMeetingService.meeting; } - /** - * @deprecated Typo: use `meetingSettingsService` instead - */ - protected get meetingSettingService(): MeetingSettingsService { - return this.componentServiceCollector.meetingSettingsService; - } - protected get meetingSettingsService(): MeetingSettingsService { return this.componentServiceCollector.meetingSettingsService; } diff --git a/client/src/app/site/pages/meetings/base/base-meeting.component.ts b/client/src/app/site/pages/meetings/base/base-meeting.component.ts index 6d3c32e9d4..23061db182 100644 --- a/client/src/app/site/pages/meetings/base/base-meeting.component.ts +++ b/client/src/app/site/pages/meetings/base/base-meeting.component.ts @@ -18,13 +18,6 @@ export abstract class BaseMeetingComponent extends BaseComponent { return this.activeMeetingService.meeting; } - /** - * @deprecated Typo: use `meetingSettingsService` instead - */ - protected get meetingSettingService(): MeetingSettingsService { - return this.componentServiceCollector.meetingSettingsService; - } - protected get meetingSettingsService(): MeetingSettingsService { return this.componentServiceCollector.meetingSettingsService; } diff --git a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-content/list-of-speakers-content.component.ts b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-content/list-of-speakers-content.component.ts index e27dbd4233..ec35fadd3e 100644 --- a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-content/list-of-speakers-content.component.ts +++ b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-content/list-of-speakers-content.component.ts @@ -69,7 +69,7 @@ export class ListOfSpeakersContentComponent extends BaseMeetingComponent impleme } public get showInterposedQuestions(): Observable { - return this.meetingSettingService.get(`list_of_speakers_enable_interposed_question`); + return this.meetingSettingsService.get(`list_of_speakers_enable_interposed_question`); } public get showPointOfOrders(): boolean { diff --git a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-entry/list-of-speakers-entry.component.ts b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-entry/list-of-speakers-entry.component.ts index 1e0ecebedc..e8c1f9cbed 100644 --- a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-entry/list-of-speakers-entry.component.ts +++ b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-entry/list-of-speakers-entry.component.ts @@ -66,7 +66,7 @@ export class ListOfSpeakersEntryComponent extends BaseMeetingComponent implement } public get showInterposedQuestions(): Observable { - return this.meetingSettingService.get(`list_of_speakers_enable_interposed_question`); + return this.meetingSettingsService.get(`list_of_speakers_enable_interposed_question`); } public get showSpeakerNoteForEveryoneObservable(): Observable { diff --git a/client/src/app/site/pages/meetings/pages/assignments/modules/assignment-poll/components/assignment-poll-form/assignment-poll-form.component.ts b/client/src/app/site/pages/meetings/pages/assignments/modules/assignment-poll/components/assignment-poll-form/assignment-poll-form.component.ts index 0cdd9b53bf..40473fc469 100644 --- a/client/src/app/site/pages/meetings/pages/assignments/modules/assignment-poll/components/assignment-poll-form/assignment-poll-form.component.ts +++ b/client/src/app/site/pages/meetings/pages/assignments/modules/assignment-poll/components/assignment-poll-form/assignment-poll-form.component.ts @@ -27,7 +27,7 @@ export class AssignmentPollFormComponent extends BasePollFormComponent implement this.data.max_votes_amount = assignment.open_posts; } if (!this.data.pollmethod) { - this.data.pollmethod = this.meetingSettingService.instant(`assignment_poll_default_method`); + this.data.pollmethod = this.meetingSettingsService.instant(`assignment_poll_default_method`); } } super.ngOnInit(); diff --git a/client/src/app/site/pages/meetings/pages/home/pages/start/components/start/start.component.ts b/client/src/app/site/pages/meetings/pages/home/pages/start/components/start/start.component.ts index e20f65a339..12b7a1bab1 100644 --- a/client/src/app/site/pages/meetings/pages/home/pages/start/components/start/start.component.ts +++ b/client/src/app/site/pages/meetings/pages/home/pages/start/components/start/start.component.ts @@ -59,7 +59,7 @@ export class StartComponent extends BaseMeetingComponent implements OnInit { */ public editStartPage(): void { Object.keys(this.startForm.controls).forEach(control => { - this.startForm.patchValue({ [control]: this.meetingSettingService.instant(control as keyof Settings) }); + this.startForm.patchValue({ [control]: this.meetingSettingsService.instant(control as keyof Settings) }); }); this.isEditing = true; } 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..54e38d5451 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 @@ -488,7 +488,7 @@ export class MotionContentComponent extends BaseMotionDetailChildComponent { agenda_parent_id: [], submitter_ids: [[]], supporter_user_ids: [[]], - workflow_id: [+this.meetingSettingService.instant(`motions_default_workflow_id`)], + workflow_id: [+this.meetingSettingsService.instant(`motions_default_workflow_id`)], tag_ids: [[]], statute_amendment: [``], // Internal value for the checkbox, not saved to the model statute_paragraph_id: [], 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..26be94755a 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 @@ -266,7 +266,7 @@ export class MotionDetailViewComponent extends BaseMeetingComponent implements O * Goes to the amendment creation wizard. Executed via click. */ public createAmendment(): void { - const amendmentTextMode = this.meetingSettingService.instant(`motions_amendments_text_mode`); + const amendmentTextMode = this.meetingSettingsService.instant(`motions_amendments_text_mode`); if (amendmentTextMode === `paragraph`) { this.router.navigate([`create-amendment`], { relativeTo: this.route }); } else { @@ -513,7 +513,7 @@ export class MotionDetailViewComponent extends BaseMeetingComponent implements O const defaultTitle = `${this.translate.instant(`Amendment to`)} ${parentMotion.numberOrTitle}`; motion.title = defaultTitle; motion.category_id = parentMotion.category_id; - const amendmentTextMode = this.meetingSettingService.instant(`motions_amendments_text_mode`); + const amendmentTextMode = this.meetingSettingsService.instant(`motions_amendments_text_mode`); if (amendmentTextMode === `fulltext`) { motion.text = parentMotion.text; } diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-speaker-list/components/participant-speaker-list/participant-speaker-list.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-speaker-list/components/participant-speaker-list/participant-speaker-list.component.ts index 8a2f5c55e2..73d9b13bd4 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-speaker-list/components/participant-speaker-list/participant-speaker-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-speaker-list/components/participant-speaker-list/participant-speaker-list.component.ts @@ -31,7 +31,7 @@ export class ParticipantSpeakerListComponent extends BaseMeetingListViewComponen public genderList = GENDERS; public get structureLevelCountdownEnabled(): Observable { - return this.meetingSettingService.get(`list_of_speakers_default_structure_level_time`).pipe(map(v => v > 0)); + return this.meetingSettingsService.get(`list_of_speakers_default_structure_level_time`).pipe(map(v => v > 0)); } /** From 8e94cee63a86f116e33dfb42d061ef0c9e073bae Mon Sep 17 00:00:00 2001 From: Elblinator Date: Fri, 3 May 2024 14:45:06 +0200 Subject: [PATCH 2/5] adjust rest of names --- .../components/base-poll-form/base-poll-form.component.ts | 6 +++--- client/src/app/site/services/auth-check.service.ts | 4 ++-- .../repo-search-selector/repo-search-selector.component.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/app/site/pages/meetings/modules/poll/components/base-poll-form/base-poll-form.component.ts b/client/src/app/site/pages/meetings/modules/poll/components/base-poll-form/base-poll-form.component.ts index c9574ec6ed..b5386ce5b3 100644 --- a/client/src/app/site/pages/meetings/modules/poll/components/base-poll-form/base-poll-form.component.ts +++ b/client/src/app/site/pages/meetings/modules/poll/components/base-poll-form/base-poll-form.component.ts @@ -179,7 +179,7 @@ export abstract class BasePollFormComponent extends BaseComponent implements OnI private fb = inject(UntypedFormBuilder); public groupRepo = inject(GroupControllerService); private dialog = inject(VotingPrivacyWarningDialogService); - protected meetingSettingService = inject(MeetingSettingsService); + protected meetingSettingsService = inject(MeetingSettingsService); /** * Constructor. Retrieves necessary metadata from the pollService, * injects the poll itself @@ -257,9 +257,9 @@ export abstract class BasePollFormComponent extends BaseComponent implements OnI const pollType = this.data.content_object?.collection as PollClassType; if (!this.data.backend) { if (pollType !== `topic`) { - this.data.backend = this.meetingSettingService.instant(`${pollType}_poll_default_backend`); + this.data.backend = this.meetingSettingsService.instant(`${pollType}_poll_default_backend`); } else { - this.data.backend = this.meetingSettingService.instant(`poll_default_backend`); + this.data.backend = this.meetingSettingsService.instant(`poll_default_backend`); } } } diff --git a/client/src/app/site/services/auth-check.service.ts b/client/src/app/site/services/auth-check.service.ts index 8e12d6b07d..ff4c992484 100644 --- a/client/src/app/site/services/auth-check.service.ts +++ b/client/src/app/site/services/auth-check.service.ts @@ -31,7 +31,7 @@ export class AuthCheckService { public constructor( private operator: OperatorService, private activeMeeting: ActiveMeetingService, - private meetingSettingService: MeetingSettingsService, + private meetingSettingsService: MeetingSettingsService, private osRouter: OpenSlidesRouterService ) {} @@ -97,6 +97,6 @@ export class AuthCheckService { if (!meetingSetting) { return true; } - return this.meetingSettingService.instant(meetingSetting) as boolean; + return this.meetingSettingsService.instant(meetingSetting) as boolean; } } diff --git a/client/src/app/ui/modules/search-selector/components/repo-search-selector/repo-search-selector.component.ts b/client/src/app/ui/modules/search-selector/components/repo-search-selector/repo-search-selector.component.ts index 70822d4a56..0ca66f7e86 100644 --- a/client/src/app/ui/modules/search-selector/components/repo-search-selector/repo-search-selector.component.ts +++ b/client/src/app/ui/modules/search-selector/components/repo-search-selector/repo-search-selector.component.ts @@ -51,7 +51,7 @@ export class RepoSearchSelectorComponent extends BaseSearchSelectorComponent imp public constructor( @Optional() @Self() ngControl: NgControl, - private meetingSettingService: MeetingSettingsService, + private meetingSettingsService: MeetingSettingsService, private modelRequestService: ModelRequestService ) { super(ngControl); @@ -83,7 +83,7 @@ export class RepoSearchSelectorComponent extends BaseSearchSelectorComponent imp this.initItems(); if (this.defaultDataConfigKey) { this.subscriptions.push( - this.meetingSettingService.get(this.defaultDataConfigKey).subscribe(value => { + this.meetingSettingsService.get(this.defaultDataConfigKey).subscribe(value => { if (this.empty) { this.value = value as any; } From ce9b749e7a470cf887d3d1ec36318ec6e4d52af1 Mon Sep 17 00:00:00 2001 From: Elblinator Date: Fri, 3 May 2024 16:19:10 +0200 Subject: [PATCH 3/5] add return types --- 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 54e38d5451..aca591b343 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 26be94755a..441e0a28c0 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; } } From bb01329e22189849ef2eea2568fec23da142cc95 Mon Sep 17 00:00:00 2001 From: Loki Tobias Elble Date: Mon, 6 May 2024 13:41:29 +0200 Subject: [PATCH 4/5] Revert "remove deprecated and exchange it with correct function" This reverts commit 3ac553b4ad64c2edbef600a45c1473a5fab8aef3. --- .../meetings/base/base-meeting-list-view.component.ts | 7 +++++++ .../app/site/pages/meetings/base/base-meeting.component.ts | 7 +++++++ .../list-of-speakers-content.component.ts | 2 +- .../list-of-speakers-entry.component.ts | 2 +- .../assignment-poll-form/assignment-poll-form.component.ts | 2 +- .../home/pages/start/components/start/start.component.ts | 2 +- .../components/motion-content/motion-content.component.ts | 2 +- .../motion-detail-view/motion-detail-view.component.ts | 4 ++-- .../participant-speaker-list.component.ts | 2 +- 9 files changed, 22 insertions(+), 8 deletions(-) diff --git a/client/src/app/site/pages/meetings/base/base-meeting-list-view.component.ts b/client/src/app/site/pages/meetings/base/base-meeting-list-view.component.ts index b487cb6cc6..73ce9d1bb9 100644 --- a/client/src/app/site/pages/meetings/base/base-meeting-list-view.component.ts +++ b/client/src/app/site/pages/meetings/base/base-meeting-list-view.component.ts @@ -20,6 +20,13 @@ export abstract class BaseMeetingListViewComponent exte return this.activeMeetingService.meeting; } + /** + * @deprecated Typo: use `meetingSettingsService` instead + */ + protected get meetingSettingService(): MeetingSettingsService { + return this.componentServiceCollector.meetingSettingsService; + } + protected get meetingSettingsService(): MeetingSettingsService { return this.componentServiceCollector.meetingSettingsService; } diff --git a/client/src/app/site/pages/meetings/base/base-meeting.component.ts b/client/src/app/site/pages/meetings/base/base-meeting.component.ts index 23061db182..6d3c32e9d4 100644 --- a/client/src/app/site/pages/meetings/base/base-meeting.component.ts +++ b/client/src/app/site/pages/meetings/base/base-meeting.component.ts @@ -18,6 +18,13 @@ export abstract class BaseMeetingComponent extends BaseComponent { return this.activeMeetingService.meeting; } + /** + * @deprecated Typo: use `meetingSettingsService` instead + */ + protected get meetingSettingService(): MeetingSettingsService { + return this.componentServiceCollector.meetingSettingsService; + } + protected get meetingSettingsService(): MeetingSettingsService { return this.componentServiceCollector.meetingSettingsService; } diff --git a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-content/list-of-speakers-content.component.ts b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-content/list-of-speakers-content.component.ts index ec35fadd3e..e27dbd4233 100644 --- a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-content/list-of-speakers-content.component.ts +++ b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-content/list-of-speakers-content.component.ts @@ -69,7 +69,7 @@ export class ListOfSpeakersContentComponent extends BaseMeetingComponent impleme } public get showInterposedQuestions(): Observable { - return this.meetingSettingsService.get(`list_of_speakers_enable_interposed_question`); + return this.meetingSettingService.get(`list_of_speakers_enable_interposed_question`); } public get showPointOfOrders(): boolean { diff --git a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-entry/list-of-speakers-entry.component.ts b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-entry/list-of-speakers-entry.component.ts index e8c1f9cbed..1e0ecebedc 100644 --- a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-entry/list-of-speakers-entry.component.ts +++ b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/list-of-speakers-entry/list-of-speakers-entry.component.ts @@ -66,7 +66,7 @@ export class ListOfSpeakersEntryComponent extends BaseMeetingComponent implement } public get showInterposedQuestions(): Observable { - return this.meetingSettingsService.get(`list_of_speakers_enable_interposed_question`); + return this.meetingSettingService.get(`list_of_speakers_enable_interposed_question`); } public get showSpeakerNoteForEveryoneObservable(): Observable { diff --git a/client/src/app/site/pages/meetings/pages/assignments/modules/assignment-poll/components/assignment-poll-form/assignment-poll-form.component.ts b/client/src/app/site/pages/meetings/pages/assignments/modules/assignment-poll/components/assignment-poll-form/assignment-poll-form.component.ts index 40473fc469..0cdd9b53bf 100644 --- a/client/src/app/site/pages/meetings/pages/assignments/modules/assignment-poll/components/assignment-poll-form/assignment-poll-form.component.ts +++ b/client/src/app/site/pages/meetings/pages/assignments/modules/assignment-poll/components/assignment-poll-form/assignment-poll-form.component.ts @@ -27,7 +27,7 @@ export class AssignmentPollFormComponent extends BasePollFormComponent implement this.data.max_votes_amount = assignment.open_posts; } if (!this.data.pollmethod) { - this.data.pollmethod = this.meetingSettingsService.instant(`assignment_poll_default_method`); + this.data.pollmethod = this.meetingSettingService.instant(`assignment_poll_default_method`); } } super.ngOnInit(); diff --git a/client/src/app/site/pages/meetings/pages/home/pages/start/components/start/start.component.ts b/client/src/app/site/pages/meetings/pages/home/pages/start/components/start/start.component.ts index 12b7a1bab1..e20f65a339 100644 --- a/client/src/app/site/pages/meetings/pages/home/pages/start/components/start/start.component.ts +++ b/client/src/app/site/pages/meetings/pages/home/pages/start/components/start/start.component.ts @@ -59,7 +59,7 @@ export class StartComponent extends BaseMeetingComponent implements OnInit { */ public editStartPage(): void { Object.keys(this.startForm.controls).forEach(control => { - this.startForm.patchValue({ [control]: this.meetingSettingsService.instant(control as keyof Settings) }); + this.startForm.patchValue({ [control]: this.meetingSettingService.instant(control as keyof Settings) }); }); this.isEditing = true; } 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 aca591b343..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 @@ -488,7 +488,7 @@ export class MotionContentComponent extends BaseMotionDetailChildComponent { agenda_parent_id: [], submitter_ids: [[]], supporter_user_ids: [[]], - workflow_id: [+this.meetingSettingsService.instant(`motions_default_workflow_id`)], + workflow_id: [+this.meetingSettingService.instant(`motions_default_workflow_id`)], tag_ids: [[]], statute_amendment: [``], // Internal value for the checkbox, not saved to the model statute_paragraph_id: [], 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 441e0a28c0..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 @@ -266,7 +266,7 @@ export class MotionDetailViewComponent extends BaseMeetingComponent implements O * Goes to the amendment creation wizard. Executed via click. */ public createAmendment(): void { - const amendmentTextMode = this.meetingSettingsService.instant(`motions_amendments_text_mode`); + const amendmentTextMode = this.meetingSettingService.instant(`motions_amendments_text_mode`); if (amendmentTextMode === `paragraph`) { this.router.navigate([`create-amendment`], { relativeTo: this.route }); } else { @@ -513,7 +513,7 @@ export class MotionDetailViewComponent extends BaseMeetingComponent implements O const defaultTitle = `${this.translate.instant(`Amendment to`)} ${parentMotion.numberOrTitle}`; motion.title = defaultTitle; motion.category_id = parentMotion.category_id; - const amendmentTextMode = this.meetingSettingsService.instant(`motions_amendments_text_mode`); + const amendmentTextMode = this.meetingSettingService.instant(`motions_amendments_text_mode`); if (amendmentTextMode === `fulltext`) { motion.text = parentMotion.text; } diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-speaker-list/components/participant-speaker-list/participant-speaker-list.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-speaker-list/components/participant-speaker-list/participant-speaker-list.component.ts index 73d9b13bd4..8a2f5c55e2 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-speaker-list/components/participant-speaker-list/participant-speaker-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-speaker-list/components/participant-speaker-list/participant-speaker-list.component.ts @@ -31,7 +31,7 @@ export class ParticipantSpeakerListComponent extends BaseMeetingListViewComponen public genderList = GENDERS; public get structureLevelCountdownEnabled(): Observable { - return this.meetingSettingsService.get(`list_of_speakers_default_structure_level_time`).pipe(map(v => v > 0)); + return this.meetingSettingService.get(`list_of_speakers_default_structure_level_time`).pipe(map(v => v > 0)); } /** From f7a1458b0d300b81a42ebdbc5da50a0ee9144e93 Mon Sep 17 00:00:00 2001 From: Loki Tobias Elble Date: Mon, 6 May 2024 13:41:49 +0200 Subject: [PATCH 5/5] Revert "adjust rest of names" This reverts commit 8e94cee63a86f116e33dfb42d061ef0c9e073bae. --- .../components/base-poll-form/base-poll-form.component.ts | 6 +++--- client/src/app/site/services/auth-check.service.ts | 4 ++-- .../repo-search-selector/repo-search-selector.component.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/app/site/pages/meetings/modules/poll/components/base-poll-form/base-poll-form.component.ts b/client/src/app/site/pages/meetings/modules/poll/components/base-poll-form/base-poll-form.component.ts index b5386ce5b3..c9574ec6ed 100644 --- a/client/src/app/site/pages/meetings/modules/poll/components/base-poll-form/base-poll-form.component.ts +++ b/client/src/app/site/pages/meetings/modules/poll/components/base-poll-form/base-poll-form.component.ts @@ -179,7 +179,7 @@ export abstract class BasePollFormComponent extends BaseComponent implements OnI private fb = inject(UntypedFormBuilder); public groupRepo = inject(GroupControllerService); private dialog = inject(VotingPrivacyWarningDialogService); - protected meetingSettingsService = inject(MeetingSettingsService); + protected meetingSettingService = inject(MeetingSettingsService); /** * Constructor. Retrieves necessary metadata from the pollService, * injects the poll itself @@ -257,9 +257,9 @@ export abstract class BasePollFormComponent extends BaseComponent implements OnI const pollType = this.data.content_object?.collection as PollClassType; if (!this.data.backend) { if (pollType !== `topic`) { - this.data.backend = this.meetingSettingsService.instant(`${pollType}_poll_default_backend`); + this.data.backend = this.meetingSettingService.instant(`${pollType}_poll_default_backend`); } else { - this.data.backend = this.meetingSettingsService.instant(`poll_default_backend`); + this.data.backend = this.meetingSettingService.instant(`poll_default_backend`); } } } diff --git a/client/src/app/site/services/auth-check.service.ts b/client/src/app/site/services/auth-check.service.ts index ff4c992484..8e12d6b07d 100644 --- a/client/src/app/site/services/auth-check.service.ts +++ b/client/src/app/site/services/auth-check.service.ts @@ -31,7 +31,7 @@ export class AuthCheckService { public constructor( private operator: OperatorService, private activeMeeting: ActiveMeetingService, - private meetingSettingsService: MeetingSettingsService, + private meetingSettingService: MeetingSettingsService, private osRouter: OpenSlidesRouterService ) {} @@ -97,6 +97,6 @@ export class AuthCheckService { if (!meetingSetting) { return true; } - return this.meetingSettingsService.instant(meetingSetting) as boolean; + return this.meetingSettingService.instant(meetingSetting) as boolean; } } diff --git a/client/src/app/ui/modules/search-selector/components/repo-search-selector/repo-search-selector.component.ts b/client/src/app/ui/modules/search-selector/components/repo-search-selector/repo-search-selector.component.ts index 0ca66f7e86..70822d4a56 100644 --- a/client/src/app/ui/modules/search-selector/components/repo-search-selector/repo-search-selector.component.ts +++ b/client/src/app/ui/modules/search-selector/components/repo-search-selector/repo-search-selector.component.ts @@ -51,7 +51,7 @@ export class RepoSearchSelectorComponent extends BaseSearchSelectorComponent imp public constructor( @Optional() @Self() ngControl: NgControl, - private meetingSettingsService: MeetingSettingsService, + private meetingSettingService: MeetingSettingsService, private modelRequestService: ModelRequestService ) { super(ngControl); @@ -83,7 +83,7 @@ export class RepoSearchSelectorComponent extends BaseSearchSelectorComponent imp this.initItems(); if (this.defaultDataConfigKey) { this.subscriptions.push( - this.meetingSettingsService.get(this.defaultDataConfigKey).subscribe(value => { + this.meetingSettingService.get(this.defaultDataConfigKey).subscribe(value => { if (this.empty) { this.value = value as any; }