From 84974d7687ed94ed41665ae4717d85df75ce0235 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Thu, 31 Jan 2019 08:20:15 +0100 Subject: [PATCH] A little bit of cleanup --- .../core/core-services/servertime.service.ts | 1 - .../users/group-repository.service.ts | 2 +- .../app/core/ui-services/config.service.ts | 2 +- .../app/core/ui-services/constants.service.ts | 4 +- .../src/app/core/ui-services/diff.service.ts | 1 + .../core/ui-services/login-data.service.ts | 4 +- .../core/ui-services/personal-note.service.ts | 2 + .../src/app/core/ui-services/theme.service.ts | 2 +- .../filter-menu/filter-menu.component.ts | 2 +- .../os-sort-bottom-sheet.component.ts | 2 +- .../agenda-list/agenda-list.component.ts | 6 +- .../agenda-sort/agenda-sort.component.ts | 2 +- .../speaker-list/speaker-list.component.ts | 2 +- .../topic-detail/topic-detail.component.ts | 2 +- .../components/start/start.component.ts | 2 +- .../history-list/history-list.component.ts | 2 +- .../login-mask/login-mask.component.ts | 6 +- .../media-upload/media-upload.component.ts | 2 +- .../mediafile-list.component.ts | 4 +- .../amendment-create-wizard.component.ts | 8 +-- .../call-list/call-list.component.ts | 2 +- .../category-list/category-list.component.ts | 2 +- .../manage-submitters.component.ts | 4 +- .../motion-block-detail.component.ts | 4 +- .../motion-block-list.component.ts | 6 +- ...on-change-recommendation.component.spec.ts | 2 +- .../motion-change-recommendation.component.ts | 10 +-- .../motion-comment-section-list.component.ts | 10 +-- .../motion-comments.component.ts | 5 +- .../motion-detail-diff.component.ts | 22 +++--- ...iginal-change-recommendations.component.ts | 5 +- .../motion-detail/motion-detail.component.ts | 69 ++++++++++--------- .../motion-import-list.component.ts | 1 + .../motion-list/motion-list.component.ts | 22 +++--- .../motion-poll/motion-poll.component.ts | 5 +- .../personal-note/personal-note.component.ts | 7 +- .../statute-paragraph-list.component.ts | 8 +-- .../services/local-permissions.service.ts | 16 +++-- .../motions/services/motion-import.service.ts | 1 + .../services/motion-poll-pdf.service.ts | 14 ++-- .../motions/services/motion-poll.service.ts | 6 +- .../services/motion-sort-list.service.ts | 1 + .../countdown-list.component.ts | 4 +- .../projector-detail.component.ts | 2 +- .../projector-list.component.ts | 2 +- client/src/app/site/site.component.html | 2 +- .../components/tag-list/tag-list.component.ts | 4 +- .../group-list/group-list.component.ts | 4 +- .../components/password/password.component.ts | 4 +- .../presence-detail.component.ts | 2 +- .../user-detail/user-detail.component.ts | 8 +-- .../user-list/user-list.component.ts | 16 ++--- 52 files changed, 181 insertions(+), 147 deletions(-) diff --git a/client/src/app/core/core-services/servertime.service.ts b/client/src/app/core/core-services/servertime.service.ts index dddd5e377..9f079736f 100644 --- a/client/src/app/core/core-services/servertime.service.ts +++ b/client/src/app/core/core-services/servertime.service.ts @@ -66,7 +66,6 @@ export class ServertimeService extends OpenSlidesComponent { private async refreshServertime(): Promise { // servertime is the time in seconds. const servertime = await this.http.get(environment.urlPrefix + '/core/servertime/'); - // isNumber is deprecated: since node v4.0.0 if (typeof servertime !== 'number') { throw new Error('The returned servertime is not a number'); } diff --git a/client/src/app/core/repositories/users/group-repository.service.ts b/client/src/app/core/repositories/users/group-repository.service.ts index c6067951e..7d2709fc9 100644 --- a/client/src/app/core/repositories/users/group-repository.service.ts +++ b/client/src/app/core/repositories/users/group-repository.service.ts @@ -77,7 +77,7 @@ export class GroupRepositoryService extends BaseRepository { * read the constants, add them to an array of apps */ private sortPermsPerApp(): void { - this.constants.get('permissions').subscribe(perms => { + this.constants.get('permissions').subscribe(perms => { for (const perm of perms) { // extract the apps name const permApp = perm.value.split('.')[0]; diff --git a/client/src/app/core/ui-services/config.service.ts b/client/src/app/core/ui-services/config.service.ts index b0aa0a9b0..044b315fc 100644 --- a/client/src/app/core/ui-services/config.service.ts +++ b/client/src/app/core/ui-services/config.service.ts @@ -67,7 +67,7 @@ export class ConfigService extends OpenSlidesComponent { * * @param key The config value to get from. */ - public get(key: string): Observable { + public get(key: string): Observable { if (!this.configSubjects[key]) { this.configSubjects[key] = new BehaviorSubject(this.instant(key)); } diff --git a/client/src/app/core/ui-services/constants.service.ts b/client/src/app/core/ui-services/constants.service.ts index 7d7ecccad..ca67ebd5a 100644 --- a/client/src/app/core/ui-services/constants.service.ts +++ b/client/src/app/core/ui-services/constants.service.ts @@ -76,7 +76,7 @@ export class ConstantsService extends OpenSlidesComponent { * Get the constant named by key. * @param key The constant to get. */ - public get(key: string): Observable { + public get(key: string): Observable { if (this.constants) { return of(this.constants[key]); } else { @@ -91,7 +91,7 @@ export class ConstantsService extends OpenSlidesComponent { if (!this.pendingSubject[key]) { this.pendingSubject[key] = new Subject(); } - return this.pendingSubject[key].asObservable(); + return this.pendingSubject[key].asObservable() as Observable; } } } diff --git a/client/src/app/core/ui-services/diff.service.ts b/client/src/app/core/ui-services/diff.service.ts index b19a59e59..64de58a40 100644 --- a/client/src/app/core/ui-services/diff.service.ts +++ b/client/src/app/core/ui-services/diff.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@angular/core'; + import { LinenumberingService } from './linenumbering.service'; import { ViewMotion } from '../../site/motions/models/view-motion'; import { ViewUnifiedChange } from '../../site/motions/models/view-unified-change'; diff --git a/client/src/app/core/ui-services/login-data.service.ts b/client/src/app/core/ui-services/login-data.service.ts index 7771f852c..0ac74d893 100644 --- a/client/src/app/core/ui-services/login-data.service.ts +++ b/client/src/app/core/ui-services/login-data.service.ts @@ -45,10 +45,10 @@ export class LoginDataService extends OpenSlidesComponent { public constructor(private configService: ConfigService) { super(); - this.configService.get('general_event_privacy_policy').subscribe(value => { + this.configService.get('general_event_privacy_policy').subscribe(value => { this.setPrivacyPolicy(value); }); - this.configService.get('general_event_legal_notice').subscribe(value => { + this.configService.get('general_event_legal_notice').subscribe(value => { this.setLegalNotice(value); }); } diff --git a/client/src/app/core/ui-services/personal-note.service.ts b/client/src/app/core/ui-services/personal-note.service.ts index 9e162e3b6..f6453b9a4 100644 --- a/client/src/app/core/ui-services/personal-note.service.ts +++ b/client/src/app/core/ui-services/personal-note.service.ts @@ -1,5 +1,7 @@ import { Injectable } from '@angular/core'; + import { Observable, BehaviorSubject } from 'rxjs'; + import { DataStoreService } from '../core-services/data-store.service'; import { OperatorService } from '../core-services/operator.service'; import { PersonalNote, PersonalNoteObject, PersonalNoteContent } from '../../shared/models/users/personal-note'; diff --git a/client/src/app/core/ui-services/theme.service.ts b/client/src/app/core/ui-services/theme.service.ts index c7e507996..350851b89 100644 --- a/client/src/app/core/ui-services/theme.service.ts +++ b/client/src/app/core/ui-services/theme.service.ts @@ -16,7 +16,7 @@ export class ThemeService { * @param configService must be injected to get the data from server. */ public constructor(configService: ConfigService) { - configService.get('openslides_theme').subscribe(newTheme => { + configService.get('openslides_theme').subscribe(newTheme => { // Listen to the related event. const classList = document.getElementsByTagName('body')[0].classList; // Get the classlist of the body. if (newTheme) { diff --git a/client/src/app/shared/components/os-sort-filter-bar/filter-menu/filter-menu.component.ts b/client/src/app/shared/components/os-sort-filter-bar/filter-menu/filter-menu.component.ts index 920a8cb53..bdd4f4566 100644 --- a/client/src/app/shared/components/os-sort-filter-bar/filter-menu/filter-menu.component.ts +++ b/client/src/app/shared/components/os-sort-filter-bar/filter-menu/filter-menu.component.ts @@ -1,5 +1,5 @@ import { Output, Component, OnInit, EventEmitter, Input } from '@angular/core'; -import { BaseFilterListService, OsFilterOption } from '../../../../core/ui-services/base-filter-list.service'; +import { BaseFilterListService, OsFilterOption } from 'app/core/ui-services/base-filter-list.service'; /** * Component for selecting the filters in a filter menu. diff --git a/client/src/app/shared/components/os-sort-filter-bar/os-sort-bottom-sheet/os-sort-bottom-sheet.component.ts b/client/src/app/shared/components/os-sort-filter-bar/os-sort-bottom-sheet/os-sort-bottom-sheet.component.ts index 0630792a4..eec486716 100644 --- a/client/src/app/shared/components/os-sort-filter-bar/os-sort-bottom-sheet/os-sort-bottom-sheet.component.ts +++ b/client/src/app/shared/components/os-sort-filter-bar/os-sort-bottom-sheet/os-sort-bottom-sheet.component.ts @@ -1,7 +1,7 @@ import { Inject, Component, OnInit } from '@angular/core'; import { MatBottomSheetRef, MAT_BOTTOM_SHEET_DATA } from '@angular/material'; import { BaseViewModel } from '../../../../site/base/base-view-model'; -import { BaseSortListService } from '../../../../core/ui-services/base-sort-list.service'; +import { BaseSortListService } from 'app/core/ui-services/base-sort-list.service'; /** * A bottom sheet used for setting a list's sorting, used by {@link SortFilterBarComponent} diff --git a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts index 62122c3e5..0ee6a9d8c 100644 --- a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts +++ b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts @@ -5,9 +5,9 @@ import { MatSnackBar, MatDialog } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; import { AgendaFilterListService } from '../../services/agenda-filter-list.service'; -import { AgendaRepositoryService } from '../../../../core/repositories/agenda/agenda-repository.service'; +import { AgendaRepositoryService } from 'app/core/repositories/agenda/agenda-repository.service'; import { ListViewBaseComponent } from 'app/site/base/list-view-base'; -import { PromptService } from '../../../../core/ui-services/prompt.service'; +import { PromptService } from 'app/core/ui-services/prompt.service'; import { ViewItem } from '../../models/view-item'; import { AgendaCsvExportService } from '../../services/agenda-csv-export.service'; @@ -93,7 +93,7 @@ export class AgendaListComponent extends ListViewBaseComponent impleme this.checkSelection(); }); this.config - .get('agenda_enable_numbering') + .get('agenda_enable_numbering') .subscribe(autoNumbering => (this.isNumberingAllowed = autoNumbering)); } diff --git a/client/src/app/site/agenda/components/agenda-sort/agenda-sort.component.ts b/client/src/app/site/agenda/components/agenda-sort/agenda-sort.component.ts index ce2bfab01..15182960d 100644 --- a/client/src/app/site/agenda/components/agenda-sort/agenda-sort.component.ts +++ b/client/src/app/site/agenda/components/agenda-sort/agenda-sort.component.ts @@ -5,7 +5,7 @@ import { MatSnackBar } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { AgendaRepositoryService } from '../../../../core/repositories/agenda/agenda-repository.service'; +import { AgendaRepositoryService } from 'app/core/repositories/agenda/agenda-repository.service'; import { BaseViewComponent } from '../../../base/base-view'; import { OSTreeSortEvent } from 'app/shared/components/sorting-tree/sorting-tree.component'; import { ViewItem } from '../../models/view-item'; diff --git a/client/src/app/site/agenda/components/speaker-list/speaker-list.component.ts b/client/src/app/site/agenda/components/speaker-list/speaker-list.component.ts index 6dac056b0..1b9406888 100644 --- a/client/src/app/site/agenda/components/speaker-list/speaker-list.component.ts +++ b/client/src/app/site/agenda/components/speaker-list/speaker-list.component.ts @@ -7,7 +7,7 @@ import { SpeakerState } from 'app/shared/models/agenda/speaker'; import { User } from 'app/shared/models/users/user'; import { ViewSpeaker } from '../../models/view-speaker'; import { DataStoreService } from 'app/core/core-services/data-store.service'; -import { AgendaRepositoryService } from '../../../../core/repositories/agenda/agenda-repository.service'; +import { AgendaRepositoryService } from 'app/core/repositories/agenda/agenda-repository.service'; import { ViewItem } from '../../models/view-item'; import { OperatorService } from 'app/core/core-services/operator.service'; import { BaseViewComponent } from 'app/site/base/base-view'; diff --git a/client/src/app/site/agenda/components/topic-detail/topic-detail.component.ts b/client/src/app/site/agenda/components/topic-detail/topic-detail.component.ts index ae329129b..d9e79e1af 100644 --- a/client/src/app/site/agenda/components/topic-detail/topic-detail.component.ts +++ b/client/src/app/site/agenda/components/topic-detail/topic-detail.component.ts @@ -8,7 +8,7 @@ import { TranslateService } from '@ngx-translate/core'; import { BaseViewComponent } from 'app/site/base/base-view'; import { PromptService } from 'app/core/ui-services/prompt.service'; -import { TopicRepositoryService } from '../../../../core/repositories/agenda/topic-repository.service'; +import { TopicRepositoryService } from 'app/core/repositories/agenda/topic-repository.service'; import { ViewTopic } from '../../models/view-topic'; import { OperatorService } from 'app/core/core-services/operator.service'; import { BehaviorSubject } from 'rxjs'; diff --git a/client/src/app/site/common/components/start/start.component.ts b/client/src/app/site/common/components/start/start.component.ts index faab7e2dd..f95985eb6 100644 --- a/client/src/app/site/common/components/start/start.component.ts +++ b/client/src/app/site/common/components/start/start.component.ts @@ -6,7 +6,7 @@ import { TranslateService } from '@ngx-translate/core'; // showcase // for testing the DS and BaseModel import { Config } from '../../../../shared/models/core/config'; -import { DataStoreService } from '../../../../core/core-services/data-store.service'; +import { DataStoreService } from 'app/core/core-services/data-store.service'; @Component({ selector: 'os-start', diff --git a/client/src/app/site/history/components/history-list/history-list.component.ts b/client/src/app/site/history/components/history-list/history-list.component.ts index 677315446..a19bc2700 100644 --- a/client/src/app/site/history/components/history-list/history-list.component.ts +++ b/client/src/app/site/history/components/history-list/history-list.component.ts @@ -6,7 +6,7 @@ import { Subject } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; import { ListViewBaseComponent } from 'app/site/base/list-view-base'; -import { HistoryRepositoryService } from '../../../../core/repositories/history/history-repository.service'; +import { HistoryRepositoryService } from 'app/core/repositories/history/history-repository.service'; import { ViewHistory } from '../../models/view-history'; /** diff --git a/client/src/app/site/login/components/login-mask/login-mask.component.ts b/client/src/app/site/login/components/login-mask/login-mask.component.ts index b0203a62b..91f5c7b9a 100644 --- a/client/src/app/site/login/components/login-mask/login-mask.component.ts +++ b/client/src/app/site/login/components/login-mask/login-mask.component.ts @@ -7,10 +7,10 @@ import { OperatorService } from 'app/core/core-services/operator.service'; import { FormGroup, Validators, FormBuilder } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { environment } from 'environments/environment'; -import { OpenSlidesService } from '../../../../core/core-services/openslides.service'; -import { LoginDataService } from '../../../../core/ui-services/login-data.service'; +import { OpenSlidesService } from 'app/core/core-services/openslides.service'; +import { LoginDataService } from 'app/core/ui-services/login-data.service'; import { ParentErrorStateMatcher } from '../../../../shared/parent-error-state-matcher'; -import { HttpService } from '../../../../core/core-services/http.service'; +import { HttpService } from 'app/core/core-services/http.service'; /** * Login mask component. diff --git a/client/src/app/site/mediafiles/components/media-upload/media-upload.component.ts b/client/src/app/site/mediafiles/components/media-upload/media-upload.component.ts index 8e933e1df..a8716aaaa 100644 --- a/client/src/app/site/mediafiles/components/media-upload/media-upload.component.ts +++ b/client/src/app/site/mediafiles/components/media-upload/media-upload.component.ts @@ -8,7 +8,7 @@ import { TranslateService } from '@ngx-translate/core'; import { BaseViewComponent } from 'app/site/base/base-view'; import { OperatorService } from 'app/core/core-services/operator.service'; -import { MediafileRepositoryService } from '../../../../core/repositories/mediafiles/mediafile-repository.service'; +import { MediafileRepositoryService } from 'app/core/repositories/mediafiles/mediafile-repository.service'; /** * To hold the structure of files to upload diff --git a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.ts b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.ts index 1c69da1b9..8acea90da 100644 --- a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.ts +++ b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.ts @@ -8,8 +8,8 @@ import { TranslateService } from '@ngx-translate/core'; import { ListViewBaseComponent } from '../../../base/list-view-base'; import { ViewMediafile } from '../../models/view-mediafile'; -import { MediafileRepositoryService } from '../../../../core/repositories/mediafiles/mediafile-repository.service'; -import { MediaManageService } from '../../../../core/ui-services/media-manage.service'; +import { MediafileRepositoryService } from 'app/core/repositories/mediafiles/mediafile-repository.service'; +import { MediaManageService } from 'app/core/ui-services/media-manage.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { Mediafile } from 'app/shared/models/mediafiles/mediafile'; import { MediafileFilterListService } from '../../services/mediafile-filter.service'; diff --git a/client/src/app/site/motions/components/amendment-create-wizard/amendment-create-wizard.component.ts b/client/src/app/site/motions/components/amendment-create-wizard/amendment-create-wizard.component.ts index 8ddcfb8d9..32180c2e3 100644 --- a/client/src/app/site/motions/components/amendment-create-wizard/amendment-create-wizard.component.ts +++ b/client/src/app/site/motions/components/amendment-create-wizard/amendment-create-wizard.component.ts @@ -5,11 +5,11 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatSnackBar } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; -import { ConfigService } from '../../../../core/ui-services/config.service'; +import { ConfigService } from 'app/core/ui-services/config.service'; -import { MotionRepositoryService } from '../../../../core/repositories/motions/motion-repository.service'; +import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { ViewMotion } from '../../models/view-motion'; -import { LinenumberingService } from '../../../../core/ui-services/linenumbering.service'; +import { LinenumberingService } from 'app/core/ui-services/linenumbering.service'; import { BaseViewComponent } from '../../../base/base-view'; import { CreateMotion } from '../../models/create-motion'; @@ -96,7 +96,7 @@ export class AmendmentCreateWizardComponent extends BaseViewComponent { super(titleService, translate, matSnackBar); this.createForm(); - this.configService.get('motions_line_length').subscribe(lineLength => { + this.configService.get('motions_line_length').subscribe(lineLength => { this.lineLength = lineLength; this.getMotionByUrl(); }); diff --git a/client/src/app/site/motions/components/call-list/call-list.component.ts b/client/src/app/site/motions/components/call-list/call-list.component.ts index c340c8f47..33fce5510 100644 --- a/client/src/app/site/motions/components/call-list/call-list.component.ts +++ b/client/src/app/site/motions/components/call-list/call-list.component.ts @@ -6,7 +6,7 @@ import { TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { BaseViewComponent } from '../../../base/base-view'; -import { MotionRepositoryService } from '../../../../core/repositories/motions/motion-repository.service'; +import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { ViewMotion } from '../../models/view-motion'; import { OSTreeSortEvent } from 'app/shared/components/sorting-tree/sorting-tree.component'; import { MotionCsvExportService } from '../../services/motion-csv-export.service'; diff --git a/client/src/app/site/motions/components/category-list/category-list.component.ts b/client/src/app/site/motions/components/category-list/category-list.component.ts index 08008c709..ff525fdd4 100644 --- a/client/src/app/site/motions/components/category-list/category-list.component.ts +++ b/client/src/app/site/motions/components/category-list/category-list.component.ts @@ -4,7 +4,7 @@ import { Title } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; import { Category } from '../../../../shared/models/motions/category'; -import { CategoryRepositoryService } from '../../../../core/repositories/motions/category-repository.service'; +import { CategoryRepositoryService } from 'app/core/repositories/motions/category-repository.service'; import { ViewCategory } from '../../models/view-category'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { Motion } from '../../../../shared/models/motions/motion'; diff --git a/client/src/app/site/motions/components/manage-submitters/manage-submitters.component.ts b/client/src/app/site/motions/components/manage-submitters/manage-submitters.component.ts index 42cd85c34..b27c30085 100644 --- a/client/src/app/site/motions/components/manage-submitters/manage-submitters.component.ts +++ b/client/src/app/site/motions/components/manage-submitters/manage-submitters.component.ts @@ -2,14 +2,14 @@ import { Component, Input } from '@angular/core'; import { FormGroup, FormControl } from '@angular/forms'; import { MatSnackBar } from '@angular/material'; import { Title } from '@angular/platform-browser'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, Observable } from 'rxjs'; import { BaseViewComponent } from 'app/site/base/base-view'; import { DataStoreService } from 'app/core/core-services/data-store.service'; import { LocalPermissionsService } from '../../services/local-permissions.service'; -import { MotionRepositoryService } from '../../../../core/repositories/motions/motion-repository.service'; +import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { User } from 'app/shared/models/users/user'; import { ViewMotion } from '../../models/view-motion'; diff --git a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.ts b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.ts index 344fa8190..3ad1d1d98 100644 --- a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.ts +++ b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.ts @@ -8,8 +8,8 @@ import { TranslateService } from '@ngx-translate/core'; import { ListViewBaseComponent } from 'app/site/base/list-view-base'; import { MotionBlock } from 'app/shared/models/motions/motion-block'; -import { MotionBlockRepositoryService } from '../../../../core/repositories/motions/motion-block-repository.service'; -import { MotionRepositoryService } from '../../../../core/repositories/motions/motion-repository.service'; +import { MotionBlockRepositoryService } from 'app/core/repositories/motions/motion-block-repository.service'; +import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { ViewMotionBlock } from '../../models/view-motion-block'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { ViewMotion } from '../../models/view-motion'; diff --git a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts index 1572f3687..8209a8238 100644 --- a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts +++ b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts @@ -3,18 +3,18 @@ import { Router, ActivatedRoute } from '@angular/router'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { Title } from '@angular/platform-browser'; import { MatSnackBar } from '@angular/material'; -import { BehaviorSubject } from 'rxjs'; +import { BehaviorSubject } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; import { ListViewBaseComponent } from 'app/site/base/list-view-base'; import { MotionBlock } from 'app/shared/models/motions/motion-block'; import { Item, itemVisibilityChoices } from 'app/shared/models/agenda/item'; import { DataStoreService } from 'app/core/core-services/data-store.service'; -import { MotionBlockRepositoryService } from '../../../../core/repositories/motions/motion-block-repository.service'; +import { MotionBlockRepositoryService } from 'app/core/repositories/motions/motion-block-repository.service'; import { ViewMotionBlock } from '../../models/view-motion-block'; import { AgendaRepositoryService } from 'app/core/repositories/agenda/agenda-repository.service'; -import { PromptService } from '../../../../core/ui-services/prompt.service'; +import { PromptService } from 'app/core/ui-services/prompt.service'; /** * Table for the motion blocks diff --git a/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.spec.ts b/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.spec.ts index 1572dba08..0ef7ede7f 100644 --- a/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.spec.ts +++ b/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.spec.ts @@ -6,7 +6,7 @@ import { } from './motion-change-recommendation.component'; import { E2EImportsModule } from '../../../../../e2e-imports.module'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; -import { ModificationType } from '../../../../core/ui-services/diff.service'; +import { ModificationType } from 'app/core/ui-services/diff.service'; import { ViewChangeReco } from '../../models/view-change-reco'; describe('MotionChangeRecommendationComponent', () => { diff --git a/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.ts b/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.ts index ce45e8b2e..fd71e309a 100644 --- a/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.ts +++ b/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.ts @@ -1,12 +1,14 @@ import { Component, Inject } from '@angular/core'; -import { LineRange, ModificationType } from '../../../../core/ui-services/diff.service'; import { MAT_DIALOG_DATA, MatDialogRef, MatSnackBar } from '@angular/material'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { ChangeRecommendationRepositoryService } from '../../../../core/repositories/motions/change-recommendation-repository.service'; +import { Title } from '@angular/platform-browser'; + +import { TranslateService } from '@ngx-translate/core'; + +import { LineRange, ModificationType } from 'app/core/ui-services/diff.service'; +import { ChangeRecommendationRepositoryService } from 'app/core/repositories/motions/change-recommendation-repository.service'; import { ViewChangeReco } from '../../models/view-change-reco'; import { BaseViewComponent } from '../../../base/base-view'; -import { Title } from '@angular/platform-browser'; -import { TranslateService } from '@ngx-translate/core'; /** * Data that needs to be provided to the MotionChangeRecommendationComponent dialog diff --git a/client/src/app/site/motions/components/motion-comment-section-list/motion-comment-section-list.component.ts b/client/src/app/site/motions/components/motion-comment-section-list/motion-comment-section-list.component.ts index 53ef29e80..e7e63c981 100644 --- a/client/src/app/site/motions/components/motion-comment-section-list/motion-comment-section-list.component.ts +++ b/client/src/app/site/motions/components/motion-comment-section-list/motion-comment-section-list.component.ts @@ -1,18 +1,18 @@ import { Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; +import { MatSnackBar } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; +import { BehaviorSubject } from 'rxjs'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { MotionCommentSection } from '../../../../shared/models/motions/motion-comment-section'; import { ViewMotionCommentSection } from '../../models/view-motion-comment-section'; -import { MotionCommentSectionRepositoryService } from '../../../../core/repositories/motions/motion-comment-section-repository.service'; -import { PromptService } from '../../../../core/ui-services/prompt.service'; -import { BehaviorSubject } from 'rxjs'; +import { MotionCommentSectionRepositoryService } from 'app/core/repositories/motions/motion-comment-section-repository.service'; +import { PromptService } from 'app/core/ui-services/prompt.service'; import { Group } from '../../../../shared/models/users/group'; -import { DataStoreService } from '../../../../core/core-services/data-store.service'; +import { DataStoreService } from 'app/core/core-services/data-store.service'; import { BaseViewComponent } from '../../../base/base-view'; -import { MatSnackBar } from '@angular/material'; /** * List view for the categories. diff --git a/client/src/app/site/motions/components/motion-comments/motion-comments.component.ts b/client/src/app/site/motions/components/motion-comments/motion-comments.component.ts index 24e8d16d7..1e58f210e 100644 --- a/client/src/app/site/motions/components/motion-comments/motion-comments.component.ts +++ b/client/src/app/site/motions/components/motion-comments/motion-comments.component.ts @@ -2,12 +2,13 @@ import { Component, Input } from '@angular/core'; import { MatSnackBar } from '@angular/material'; import { Title } from '@angular/platform-browser'; import { FormGroup, FormBuilder } from '@angular/forms'; + import { TranslateService } from '@ngx-translate/core'; import { BaseViewComponent } from '../../../../site/base/base-view'; -import { MotionCommentSectionRepositoryService } from '../../../../core/repositories/motions/motion-comment-section-repository.service'; +import { MotionCommentSectionRepositoryService } from 'app/core/repositories/motions/motion-comment-section-repository.service'; import { ViewMotionCommentSection } from '../../models/view-motion-comment-section'; -import { OperatorService } from '../../../../core/core-services/operator.service'; +import { OperatorService } from 'app/core/core-services/operator.service'; import { MotionComment } from '../../../../shared/models/motions/motion-comment'; import { ViewMotion } from '../../models/view-motion'; diff --git a/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.ts b/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.ts index d63ccc017..128405a94 100644 --- a/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.ts +++ b/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.ts @@ -1,19 +1,21 @@ import { AfterViewInit, Component, ElementRef, EventEmitter, Input, Output } from '@angular/core'; +import { MatDialog, MatSnackBar } from '@angular/material'; +import { DomSanitizer, SafeHtml, Title } from '@angular/platform-browser'; + +import { TranslateService } from '@ngx-translate/core'; + import { LineNumberingMode, ViewMotion } from '../../models/view-motion'; import { ViewUnifiedChange, ViewUnifiedChangeType } from '../../models/view-unified-change'; -import { DomSanitizer, SafeHtml, Title } from '@angular/platform-browser'; -import { MotionRepositoryService } from '../../../../core/repositories/motions/motion-repository.service'; -import { LineRange, ModificationType } from '../../../../core/ui-services/diff.service'; +import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; +import { LineRange, ModificationType } from 'app/core/ui-services/diff.service'; import { ViewChangeReco } from '../../models/view-change-reco'; -import { MatDialog, MatSnackBar } from '@angular/material'; -import { ChangeRecommendationRepositoryService } from '../../../../core/repositories/motions/change-recommendation-repository.service'; +import { ChangeRecommendationRepositoryService } from 'app/core/repositories/motions/change-recommendation-repository.service'; import { MotionChangeRecommendationComponent, MotionChangeRecommendationComponentData } from '../motion-change-recommendation/motion-change-recommendation.component'; import { BaseViewComponent } from '../../../base/base-view'; -import { TranslateService } from '@ngx-translate/core'; -import { ConfigService } from '../../../../core/ui-services/config.service'; +import { ConfigService } from 'app/core/ui-services/config.service'; /** * This component displays the original motion text with the change blocks inside. @@ -84,8 +86,10 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte ) { super(title, translate, matSnackBar); - this.configService.get('motions_default_line_numbering').subscribe(mode => (this.lnMode = mode)); - this.configService.get('motions_line_length').subscribe(lineLength => (this.lineLength = lineLength)); + this.configService + .get('motions_default_line_numbering') + .subscribe(mode => (this.lnMode = mode)); + this.configService.get('motions_line_length').subscribe(lineLength => (this.lineLength = lineLength)); } /** diff --git a/client/src/app/site/motions/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts b/client/src/app/site/motions/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts index 6d152d848..c53947383 100644 --- a/client/src/app/site/motions/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts +++ b/client/src/app/site/motions/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts @@ -9,9 +9,10 @@ import { OnChanges, SimpleChanges } from '@angular/core'; -import { LineRange, ModificationType } from '../../../../core/ui-services/diff.service'; + +import { LineRange, ModificationType } from 'app/core/ui-services/diff.service'; import { ViewChangeReco } from '../../models/view-change-reco'; -import { OperatorService } from '../../../../core/core-services/operator.service'; +import { OperatorService } from 'app/core/core-services/operator.service'; /** * This component displays the original motion text with annotated change commendations diff --git a/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts index 7981963ad..5c46e2800 100644 --- a/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts @@ -1,21 +1,22 @@ import { ActivatedRoute, Router } from '@angular/router'; -import { BehaviorSubject, Subscription, ReplaySubject, concat } from 'rxjs'; import { Component, OnInit, ViewChild } from '@angular/core'; import { DomSanitizer, SafeHtml, Title } from '@angular/platform-browser'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialog, MatExpansionPanel, MatSnackBar, MatCheckboxChange } from '@angular/material'; -import { take, takeWhile, multicast, skipWhile } from 'rxjs/operators'; + +import { BehaviorSubject, Subscription } from 'rxjs'; +import { takeWhile } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; import { AgendaRepositoryService } from 'app/core/repositories/agenda/agenda-repository.service'; import { BaseViewComponent } from '../../../base/base-view'; import { Category } from '../../../../shared/models/motions/category'; -import { ChangeRecommendationRepositoryService } from '../../../../core/repositories/motions/change-recommendation-repository.service'; +import { ChangeRecommendationRepositoryService } from 'app/core/repositories/motions/change-recommendation-repository.service'; import { ChangeRecoMode, LineNumberingMode, ViewMotion } from '../../models/view-motion'; import { CreateMotion } from '../../models/create-motion'; -import { ConfigService } from '../../../../core/ui-services/config.service'; -import { DataStoreService } from '../../../../core/core-services/data-store.service'; -import { DiffLinesInParagraph, LineRange } from '../../../../core/ui-services/diff.service'; +import { ConfigService } from 'app/core/ui-services/config.service'; +import { DataStoreService } from 'app/core/core-services/data-store.service'; +import { DiffLinesInParagraph, LineRange } from 'app/core/ui-services/diff.service'; import { itemVisibilityChoices, Item } from 'app/shared/models/agenda/item'; import { LocalPermissionsService } from '../../services/local-permissions.service'; import { Mediafile } from 'app/shared/models/mediafiles/mediafile'; @@ -26,19 +27,19 @@ import { MotionChangeRecommendationComponentData } from '../motion-change-recommendation/motion-change-recommendation.component'; import { MotionPdfExportService } from '../../services/motion-pdf-export.service'; -import { MotionRepositoryService } from '../../../../core/repositories/motions/motion-repository.service'; +import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { PersonalNoteContent } from 'app/shared/models/users/personal-note'; -import { PersonalNoteService } from '../../../../core/ui-services/personal-note.service'; -import { PromptService } from '../../../../core/ui-services/prompt.service'; -import { StatuteParagraphRepositoryService } from '../../../../core/repositories/motions/statute-paragraph-repository.service'; +import { PersonalNoteService } from 'app/core/ui-services/personal-note.service'; +import { PromptService } from 'app/core/ui-services/prompt.service'; +import { StatuteParagraphRepositoryService } from 'app/core/repositories/motions/statute-paragraph-repository.service'; import { User } from '../../../../shared/models/users/user'; import { ViewChangeReco } from '../../models/view-change-reco'; import { ViewCreateMotion } from '../../models/view-create-motion'; -import { ViewportService } from '../../../../core/ui-services/viewport.service'; +import { ViewportService } from 'app/core/ui-services/viewport.service'; import { ViewUnifiedChange } from '../../models/view-unified-change'; import { ViewStatuteParagraph } from '../../models/view-statute-paragraph'; import { Workflow } from 'app/shared/models/motions/workflow'; -import { LinenumberingService } from '../../../../core/ui-services/linenumbering.service'; +import { LinenumberingService } from 'app/core/ui-services/linenumbering.service'; /** * Component for the motion detail view @@ -375,14 +376,26 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit { }); // load config variables - this.configService.get('motions_statutes_enabled').subscribe(enabled => (this.statutesEnabled = enabled)); - this.configService.get('motions_reason_required').subscribe(required => (this.reasonRequired = required)); - this.configService.get('motions_min_supporters').subscribe(supporters => (this.minSupporters = supporters)); - this.configService.get('motions_preamble').subscribe(preamble => (this.preamble = preamble)); - this.configService.get('motions_amendments_enabled').subscribe(enabled => (this.amendmentsEnabled = enabled)); - this.configService.get('motions_line_length').subscribe(lineLength => (this.lineLength = lineLength)); - this.configService.get('motions_default_line_numbering').subscribe(mode => (this.lnMode = mode)); - this.configService.get('motions_recommendation_text_mode').subscribe(mode => (this.crMode = mode)); + this.configService + .get('motions_statutes_enabled') + .subscribe(enabled => (this.statutesEnabled = enabled)); + this.configService + .get('motions_reason_required') + .subscribe(required => (this.reasonRequired = required)); + this.configService + .get('motions_min_supporters') + .subscribe(supporters => (this.minSupporters = supporters)); + this.configService.get('motions_preamble').subscribe(preamble => (this.preamble = preamble)); + this.configService + .get('motions_amendments_enabled') + .subscribe(enabled => (this.amendmentsEnabled = enabled)); + this.configService.get('motions_line_length').subscribe(lineLength => (this.lineLength = lineLength)); + this.configService + .get('motions_default_line_numbering') + .subscribe(mode => (this.lnMode = mode)); + this.configService + .get('motions_recommendation_text_mode') + .subscribe(mode => (this.crMode = mode)); } /** @@ -862,21 +875,9 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit { public updateWorkflowIdForCreateForm(): void { const isStatuteAmendment = !!this.contentForm.get('statute_amendment').value; const configKey = isStatuteAmendment ? 'motions_statute_amendments_workflow' : 'motions_workflow'; - // TODO: This should just be a takeWhile(id => !id), but should include the last one where the id is OK. - // takeWhile will get a inclusive parameter, see https://github.com/ReactiveX/rxjs/pull/4115 this.configService .get(configKey) - .pipe( - multicast( - () => new ReplaySubject(1), - ids => - ids.pipe( - takeWhile(id => !id), - o => concat(o, ids.pipe(take(1))) - ) - ), - skipWhile(id => !id) - ) + .pipe(takeWhile(id => !id, true)) // Wait for the id to be present. .subscribe(id => { this.contentForm.patchValue({ workflow_id: parseInt(id as string, 10) @@ -1035,7 +1036,7 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit { if (this.recommenderSubscription) { this.recommenderSubscription.unsubscribe(); } - this.recommenderSubscription = this.configService.get(configKey).subscribe(recommender => { + this.recommenderSubscription = this.configService.get(configKey).subscribe(recommender => { this.recommender = recommender; }); } diff --git a/client/src/app/site/motions/components/motion-import-list/motion-import-list.component.ts b/client/src/app/site/motions/components/motion-import-list/motion-import-list.component.ts index 8a75ef0a1..e4e361548 100644 --- a/client/src/app/site/motions/components/motion-import-list/motion-import-list.component.ts +++ b/client/src/app/site/motions/components/motion-import-list/motion-import-list.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import { MatSnackBar } from '@angular/material'; import { Title } from '@angular/platform-browser'; + import { TranslateService } from '@ngx-translate/core'; import { BaseImportListComponent } from 'app/site/base/base-import-list'; diff --git a/client/src/app/site/motions/components/motion-list/motion-list.component.ts b/client/src/app/site/motions/components/motion-list/motion-list.component.ts index e5ca4527e..5914935d4 100644 --- a/client/src/app/site/motions/components/motion-list/motion-list.component.ts +++ b/client/src/app/site/motions/components/motion-list/motion-list.component.ts @@ -5,15 +5,15 @@ import { MatSnackBar, MatDialog } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; -import { CategoryRepositoryService } from '../../../../core/repositories/motions/category-repository.service'; -import { ConfigService } from '../../../../core/ui-services/config.service'; +import { CategoryRepositoryService } from 'app/core/repositories/motions/category-repository.service'; +import { ConfigService } from 'app/core/ui-services/config.service'; import { ListViewBaseComponent } from '../../../base/list-view-base'; import { LocalPermissionsService } from '../../services/local-permissions.service'; -import { MotionBlockRepositoryService } from '../../../../core/repositories/motions/motion-block-repository.service'; +import { MotionBlockRepositoryService } from 'app/core/repositories/motions/motion-block-repository.service'; import { MotionCsvExportService } from '../../services/motion-csv-export.service'; import { MotionFilterListService } from '../../services/motion-filter-list.service'; import { MotionMultiselectService } from '../../services/motion-multiselect.service'; -import { MotionRepositoryService } from '../../../../core/repositories/motions/motion-repository.service'; +import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { MotionSortListService } from '../../services/motion-sort-list.service'; import { TagRepositoryService } from 'app/core/repositories/tags/tag-repository.service'; import { ViewCategory } from '../../models/view-category'; @@ -22,11 +22,11 @@ import { ViewMotionBlock } from '../../models/view-motion-block'; import { ViewTag } from 'app/site/tags/models/view-tag'; import { ViewWorkflow } from '../../models/view-workflow'; import { WorkflowState } from '../../../../shared/models/motions/workflow-state'; -import { WorkflowRepositoryService } from '../../../../core/repositories/motions/workflow-repository.service'; +import { WorkflowRepositoryService } from 'app/core/repositories/motions/workflow-repository.service'; import { MotionPdfExportService } from '../../services/motion-pdf-export.service'; import { MotionExportDialogComponent } from '../motion-export-dialog/motion-export-dialog.component'; -import { OperatorService } from '../../../../core/core-services/operator.service'; -import { ViewportService } from '../../../../core/ui-services/viewport.service'; +import { OperatorService } from 'app/core/core-services/operator.service'; +import { ViewportService } from 'app/core/ui-services/viewport.service'; /** * Component that displays all the motions in a Table using DataSource. @@ -120,8 +120,12 @@ export class MotionListComponent extends ListViewBaseComponent imple public ngOnInit(): void { super.setTitle('Motions'); this.initTable(); - this.configService.get('motions_statutes_enabled').subscribe(enabled => (this.statutesEnabled = enabled)); - this.configService.get('motions_recommendations_by').subscribe(id => (this.recomendationEnabled = !!id)); + this.configService + .get('motions_statutes_enabled') + .subscribe(enabled => (this.statutesEnabled = enabled)); + this.configService + .get('motions_recommendations_by') + .subscribe(recommender => (this.recomendationEnabled = !!recommender)); this.motionBlockRepo.getViewModelListObservable().subscribe(mBs => (this.motionBlocks = mBs)); this.categoryRepo.getViewModelListObservable().subscribe(cats => (this.categories = cats)); this.tagRepo.getViewModelListObservable().subscribe(tags => (this.tags = tags)); diff --git a/client/src/app/site/motions/components/motion-poll/motion-poll.component.ts b/client/src/app/site/motions/components/motion-poll/motion-poll.component.ts index e50e230e4..7fe19882b 100644 --- a/client/src/app/site/motions/components/motion-poll/motion-poll.component.ts +++ b/client/src/app/site/motions/components/motion-poll/motion-poll.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, Input } from '@angular/core'; import { MatDialog } from '@angular/material'; + import { TranslateService } from '@ngx-translate/core'; import { CalculablePollKey } from 'app/core/ui-services/poll.service'; @@ -8,7 +9,7 @@ import { LocalPermissionsService } from '../../services/local-permissions.servic import { MotionPoll } from 'app/shared/models/motions/motion-poll'; import { MotionPollService } from '../../services/motion-poll.service'; import { MotionPollDialogComponent } from './motion-poll-dialog.component'; -import { MotionRepositoryService } from '../../../../core/repositories/motions/motion-repository.service'; +import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { MotionPollPdfService } from '../../services/motion-poll-pdf.service'; @@ -225,7 +226,7 @@ export class MotionPollComponent implements OnInit { * Subscribe to the available majority choices as given in the server-side constants */ private subscribeMajorityChoices(): void { - this.constants.get('OpenSlidesConfigVariables').subscribe(constants => { + this.constants.get('OpenSlidesConfigVariables').subscribe(constants => { const motionconst = constants.find(c => c.name === 'Motions'); if (motionconst) { const ballotConst = motionconst.subgroups.find(s => s.name === 'Voting and ballot papers'); diff --git a/client/src/app/site/motions/components/personal-note/personal-note.component.ts b/client/src/app/site/motions/components/personal-note/personal-note.component.ts index 8b56621e6..cea41570c 100644 --- a/client/src/app/site/motions/components/personal-note/personal-note.component.ts +++ b/client/src/app/site/motions/components/personal-note/personal-note.component.ts @@ -1,10 +1,11 @@ import { Component, Input, OnDestroy } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; + +import { Subscription } from 'rxjs'; import { BaseComponent } from '../../../../base.component'; import { ViewMotion } from '../../models/view-motion'; -import { PersonalNoteService } from '../../../../core/ui-services/personal-note.service'; -import { Subscription } from 'rxjs'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { PersonalNoteService } from 'app/core/ui-services/personal-note.service'; import { PersonalNoteContent } from '../../../../shared/models/users/personal-note'; /** diff --git a/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts b/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts index ea67e6437..88387ba97 100644 --- a/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts +++ b/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.ts @@ -1,15 +1,15 @@ import { Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { MatSnackBar } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; -import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { PromptService } from '../../../../core/ui-services/prompt.service'; +import { PromptService } from 'app/core/ui-services/prompt.service'; import { StatuteParagraph } from '../../../../shared/models/motions/statute-paragraph'; import { ViewStatuteParagraph } from '../../models/view-statute-paragraph'; -import { StatuteParagraphRepositoryService } from '../../../../core/repositories/motions/statute-paragraph-repository.service'; +import { StatuteParagraphRepositoryService } from 'app/core/repositories/motions/statute-paragraph-repository.service'; import { BaseViewComponent } from '../../../base/base-view'; -import { MatSnackBar } from '@angular/material'; import { StatuteCsvExportService } from '../../services/statute-csv-export.service'; /** diff --git a/client/src/app/site/motions/services/local-permissions.service.ts b/client/src/app/site/motions/services/local-permissions.service.ts index 0d6816a2c..078c10381 100644 --- a/client/src/app/site/motions/services/local-permissions.service.ts +++ b/client/src/app/site/motions/services/local-permissions.service.ts @@ -1,9 +1,14 @@ import { Injectable } from '@angular/core'; + import { OperatorService } from '../../../core/core-services/operator.service'; import { ViewMotion } from '../models/view-motion'; import { ConfigService } from '../../../core/ui-services/config.service'; import { ConstantsService } from 'app/core/ui-services/constants.service'; +interface OpenSlidesSettings { + MOTIONS_ALLOW_AMENDMENTS_OF_AMENDMENTS: boolean; +} + @Injectable({ providedIn: 'root' }) @@ -19,11 +24,13 @@ export class LocalPermissionsService { ) { // load config variables this.configService - .get('motions_min_supporters') + .get('motions_min_supporters') .subscribe(supporters => (this.configMinSupporters = supporters)); - this.configService.get('motions_amendments_enabled').subscribe(enabled => (this.amendmentEnabled = enabled)); + this.configService + .get('motions_amendments_enabled') + .subscribe(enabled => (this.amendmentEnabled = enabled)); this.constants - .get('OpenSlidesSettings') + .get('OpenSlidesSettings') .subscribe(settings => (this.amendmentOfAmendment = settings.MOTIONS_ALLOW_AMENDMENTS_OF_AMENDMENTS)); } @@ -85,7 +92,8 @@ export class LocalPermissionsService { } return ( this.operator.hasPerms('motions.can_manage') || - (motion.state.allow_submitter_edit && + (motion.state && + motion.state.allow_submitter_edit && motion.submitters && motion.submitters.some(submitter => submitter.id === this.operator.user.id)) ); diff --git a/client/src/app/site/motions/services/motion-import.service.ts b/client/src/app/site/motions/services/motion-import.service.ts index 0ee128d56..a52615842 100644 --- a/client/src/app/site/motions/services/motion-import.service.ts +++ b/client/src/app/site/motions/services/motion-import.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; import { MatSnackBar } from '@angular/material'; + import { Papa } from 'ngx-papaparse'; import { TranslateService } from '@ngx-translate/core'; diff --git a/client/src/app/site/motions/services/motion-poll-pdf.service.ts b/client/src/app/site/motions/services/motion-poll-pdf.service.ts index e4c1fbd39..1fae64ca4 100644 --- a/client/src/app/site/motions/services/motion-poll-pdf.service.ts +++ b/client/src/app/site/motions/services/motion-poll-pdf.service.ts @@ -8,6 +8,8 @@ import { MotionRepositoryService } from '../../../core/repositories/motions/moti import { PdfDocumentService } from 'app/core/ui-services/pdf-document.service'; import { UserRepositoryService } from 'app/core/repositories/users/user-repository.service'; +type BallotCountChoices = 'NUMBER_OF_DELEGATES' | 'NUMBER_OF_ALL_PARTICIPANTS' | 'CUSTOM_NUMBER'; + /** * Creates a pdf for a motion poll. Takes as input any motionPoll * Provides the public method `printBallots(motionPoll)` which should be convenient to use. @@ -30,7 +32,7 @@ export class MotionPollPdfService { * - NUMBER_OF_ALL_PARTICIPANTS The amount of all registered users * - CUSTOM_NUMBER a given number of ballots (see {@link ballotCustomCount}) */ - private ballotCountSelection: 'NUMBER_OF_DELEGATES' | 'NUMBER_OF_ALL_PARTICIPANTS' | 'CUSTOM_NUMBER'; + private ballotCountSelection: BallotCountChoices; /** * An arbitrary number of ballots to print, if {@link ballotCountSection} is set @@ -64,12 +66,14 @@ export class MotionPollPdfService { private userRepo: UserRepositoryService, private pdfService: PdfDocumentService ) { - this.configService.get('motions_pdf_ballot_papers_number').subscribe(count => (this.ballotCustomCount = count)); this.configService - .get('motions_pdf_ballot_papers_selection') + .get('motions_pdf_ballot_papers_number') + .subscribe(count => (this.ballotCustomCount = count)); + this.configService + .get('motions_pdf_ballot_papers_selection') .subscribe(selection => (this.ballotCountSelection = selection)); - this.configService.get('general_event_name').subscribe(name => (this.eventName = name)); - this.configService.get('logo_pdf_ballot_paper').subscribe(url => { + this.configService.get('general_event_name').subscribe(name => (this.eventName = name)); + this.configService.get<{ path?: string }>('logo_pdf_ballot_paper').subscribe(url => { if (url && url.path) { if (url.path.indexOf('/') === 0) { url.path = url.path.substr(1); // remove prepending slash diff --git a/client/src/app/site/motions/services/motion-poll.service.ts b/client/src/app/site/motions/services/motion-poll.service.ts index 040d3219b..dabdcc45a 100644 --- a/client/src/app/site/motions/services/motion-poll.service.ts +++ b/client/src/app/site/motions/services/motion-poll.service.ts @@ -24,8 +24,10 @@ export class MotionPollService extends PollService { */ public constructor(config: ConfigService) { super(); - config.get('motions_poll_100_percent_base').subscribe(base => (this.percentBase = base)); - config.get('motions_poll_default_majority_method').subscribe(method => (this.defaultMajorityMethod = method)); + config.get('motions_poll_100_percent_base').subscribe(base => (this.percentBase = base)); + config + .get('motions_poll_default_majority_method') + .subscribe(method => (this.defaultMajorityMethod = method)); } /** diff --git a/client/src/app/site/motions/services/motion-sort-list.service.ts b/client/src/app/site/motions/services/motion-sort-list.service.ts index 6db27574e..28c424a8d 100644 --- a/client/src/app/site/motions/services/motion-sort-list.service.ts +++ b/client/src/app/site/motions/services/motion-sort-list.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@angular/core'; + import { BaseSortListService, OsSortingDefinition } from '../../../core/ui-services/base-sort-list.service'; import { ViewMotion } from '../models/view-motion'; diff --git a/client/src/app/site/projector/components/countdown-list/countdown-list.component.ts b/client/src/app/site/projector/components/countdown-list/countdown-list.component.ts index 663515397..4e644cfeb 100644 --- a/client/src/app/site/projector/components/countdown-list/countdown-list.component.ts +++ b/client/src/app/site/projector/components/countdown-list/countdown-list.component.ts @@ -4,11 +4,11 @@ import { Title } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { PromptService } from '../../../../core/ui-services/prompt.service'; +import { PromptService } from 'app/core/ui-services/prompt.service'; import { BaseViewComponent } from '../../../base/base-view'; import { MatSnackBar } from '@angular/material'; import { ViewCountdown } from '../../models/view-countdown'; -import { CountdownRepositoryService } from '../../../../core/repositories/projector/countdown-repository.service'; +import { CountdownRepositoryService } from 'app/core/repositories/projector/countdown-repository.service'; import { Countdown } from 'app/shared/models/core/countdown'; /** diff --git a/client/src/app/site/projector/components/projector-detail/projector-detail.component.ts b/client/src/app/site/projector/components/projector-detail/projector-detail.component.ts index 5d71dc692..01dfcbeff 100644 --- a/client/src/app/site/projector/components/projector-detail/projector-detail.component.ts +++ b/client/src/app/site/projector/components/projector-detail/projector-detail.component.ts @@ -8,7 +8,7 @@ import { TranslateService } from '@ngx-translate/core'; import { ProjectorRepositoryService, ScrollScaleDirection -} from '../../../../core/repositories/projector/projector-repository.service'; +} from 'app/core/repositories/projector/projector-repository.service'; import { ViewProjector } from '../../models/view-projector'; import { BaseViewComponent } from 'app/site/base/base-view'; import { ProjectorService } from 'app/core/core-services/projector.service'; diff --git a/client/src/app/site/projector/components/projector-list/projector-list.component.ts b/client/src/app/site/projector/components/projector-list/projector-list.component.ts index fe1a973a2..ac6a47d1f 100644 --- a/client/src/app/site/projector/components/projector-list/projector-list.component.ts +++ b/client/src/app/site/projector/components/projector-list/projector-list.component.ts @@ -5,7 +5,7 @@ import { MatSnackBar } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; -import { ProjectorRepositoryService } from '../../../../core/repositories/projector/projector-repository.service'; +import { ProjectorRepositoryService } from 'app/core/repositories/projector/projector-repository.service'; import { ViewProjector } from '../../models/view-projector'; import { Projector } from 'app/shared/models/core/projector'; import { BaseViewComponent } from 'app/site/base/base-view'; diff --git a/client/src/app/site/site.component.html b/client/src/app/site/site.component.html index b8b6f9dc5..a2093965c 100644 --- a/client/src/app/site/site.component.html +++ b/client/src/app/site/site.component.html @@ -35,7 +35,7 @@ mat-list-item > person - Edit profile + Show profile (this._enabledInConfig = conf)); + config.get('users_enable_presence_view').subscribe(conf => (this._enabledInConfig = conf)); } /** diff --git a/client/src/app/site/users/components/user-detail/user-detail.component.ts b/client/src/app/site/users/components/user-detail/user-detail.component.ts index 508c07f91..65c01bcbb 100644 --- a/client/src/app/site/users/components/user-detail/user-detail.component.ts +++ b/client/src/app/site/users/components/user-detail/user-detail.component.ts @@ -7,13 +7,13 @@ import { Title } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; import { BaseViewComponent } from '../../../base/base-view'; -import { DataStoreService } from '../../../../core/core-services/data-store.service'; +import { DataStoreService } from 'app/core/core-services/data-store.service'; import { genders } from 'app/shared/models/users/user'; import { Group } from '../../../../shared/models/users/group'; -import { OperatorService } from '../../../../core/core-services/operator.service'; -import { PromptService } from '../../../../core/ui-services/prompt.service'; +import { OperatorService } from 'app/core/core-services/operator.service'; +import { PromptService } from 'app/core/ui-services/prompt.service'; import { UserPdfExportService } from '../../services/user-pdf-export.service'; -import { UserRepositoryService } from '../../../../core/repositories/users/user-repository.service'; +import { UserRepositoryService } from 'app/core/repositories/users/user-repository.service'; import { ViewUser } from '../../models/view-user'; /** diff --git a/client/src/app/site/users/components/user-list/user-list.component.ts b/client/src/app/site/users/components/user-list/user-list.component.ts index c033ed932..9ee9b31c4 100644 --- a/client/src/app/site/users/components/user-list/user-list.component.ts +++ b/client/src/app/site/users/components/user-list/user-list.component.ts @@ -4,18 +4,18 @@ import { Router, ActivatedRoute } from '@angular/router'; import { Title } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; -import { ChoiceService } from '../../../../core/ui-services/choice.service'; +import { ChoiceService } from 'app/core/ui-services/choice.service'; import { ConfigService } from 'app/core/ui-services/config.service'; -import { CsvExportService } from '../../../../core/ui-services/csv-export.service'; -import { GroupRepositoryService } from '../../../../core/repositories/users/group-repository.service'; +import { CsvExportService } from 'app/core/ui-services/csv-export.service'; +import { GroupRepositoryService } from 'app/core/repositories/users/group-repository.service'; import { ListViewBaseComponent } from '../../../base/list-view-base'; -import { PromptService } from '../../../../core/ui-services/prompt.service'; +import { PromptService } from 'app/core/ui-services/prompt.service'; import { UserFilterListService } from '../../services/user-filter-list.service'; -import { UserRepositoryService } from '../../../../core/repositories/users/user-repository.service'; +import { UserRepositoryService } from 'app/core/repositories/users/user-repository.service'; import { UserPdfExportService } from '../../services/user-pdf-export.service'; import { UserSortListService } from '../../services/user-sort-list.service'; -import { ViewportService } from '../../../../core/ui-services/viewport.service'; -import { OperatorService } from '../../../../core/core-services/operator.service'; +import { ViewportService } from 'app/core/ui-services/viewport.service'; +import { OperatorService } from 'app/core/core-services/operator.service'; import { ViewUser } from '../../models/view-user'; /** @@ -92,7 +92,7 @@ export class UserListComponent extends ListViewBaseComponent implement // enable multiSelect for this listView this.canMultiSelect = true; - config.get('users_enable_presence_view').subscribe(state => (this._presenceViewConfigured = state)); + config.get('users_enable_presence_view').subscribe(state => (this._presenceViewConfigured = state)); } /**