diff --git a/client/package.json b/client/package.json index 94e262550..572428b2b 100644 --- a/client/package.json +++ b/client/package.json @@ -96,7 +96,7 @@ "karma-jasmine-html-reporter": "^1.4.0", "npm-license-crawler": "^0.2.1", "npm-run-all": "^4.1.5", - "prettier": "^1.18.2", + "prettier": "^1.19.1", "protractor": "^5.4.2", "resize-observer-polyfill": "^1.5.1", "source-map-explorer": "^2.0.1", diff --git a/client/src/app/core/ui-services/linenumbering.service.ts b/client/src/app/core/ui-services/linenumbering.service.ts index ce29aa3f0..14e4e109c 100644 --- a/client/src/app/core/ui-services/linenumbering.service.ts +++ b/client/src/app/core/ui-services/linenumbering.service.ts @@ -625,7 +625,7 @@ export class LinenumberingService { }; } } - if (lineBreakAt !== null && (node.nodeValue[i] !== ' ' && node.nodeValue[i] !== '\n')) { + if (lineBreakAt !== null && node.nodeValue[i] !== ' ' && node.nodeValue[i] !== '\n') { if (lineBreakAt.node === node) { // The last possible breaking point is in this text node const currLine = node.nodeValue.substring(currLineStart, lineBreakAt.offset + 1); diff --git a/client/src/app/core/ui-services/overlay.service.ts b/client/src/app/core/ui-services/overlay.service.ts index 99f50e699..de84dde06 100644 --- a/client/src/app/core/ui-services/overlay.service.ts +++ b/client/src/app/core/ui-services/overlay.service.ts @@ -2,10 +2,12 @@ import { Injectable } from '@angular/core'; import { MatDialog, MatDialogRef } from '@angular/material'; import { Observable, Subject } from 'rxjs'; +import { distinctUntilChanged } from 'rxjs/operators'; import { largeDialogSettings } from 'app/shared/utils/dialog-settings'; import { SuperSearchComponent } from 'app/site/common/components/super-search/super-search.component'; import { DataStoreUpgradeService } from '../core-services/data-store-upgrade.service'; +import { OfflineService } from '../core-services/offline.service'; import { OpenSlidesService } from '../core-services/openslides.service'; import { OperatorService } from '../core-services/operator.service'; @@ -43,6 +45,11 @@ export class OverlayService { */ private hasBooted = false; + /** + * Flag, whether the client is offline or not + */ + private isOffline = false; + /** * * @param dialogService Injects the `MatDialog` to show the `super-search.component` @@ -51,7 +58,8 @@ export class OverlayService { private dialogService: MatDialog, private operator: OperatorService, OpenSlides: OpenSlidesService, - upgradeService: DataStoreUpgradeService + upgradeService: DataStoreUpgradeService, + offlineService: OfflineService ) { // Subscribe to the current user. operator.getViewUserObservable().subscribe(user => { @@ -70,6 +78,14 @@ export class OverlayService { this.upgradeChecked = upgradeDone; this.checkConnection(); }); + // Subscribe to check if we are offline + offlineService + .isOffline() + .pipe(distinctUntilChanged()) + .subscribe(offline => { + this.isOffline = offline; + this.checkConnection(); + }); } /** @@ -126,7 +142,7 @@ export class OverlayService { * @returns True, if the three booleans are all true. */ public isConnectionStable(): boolean { - return this.upgradeChecked && this.hasBooted && (!!this.user || this.operator.isAnonymous); + return (this.upgradeChecked || this.isOffline) && this.hasBooted && (!!this.user || this.operator.isAnonymous); } /** diff --git a/client/src/app/core/ui-services/poll.service.ts b/client/src/app/core/ui-services/poll.service.ts index 3d11ce854..dc0566f42 100644 --- a/client/src/app/core/ui-services/poll.service.ts +++ b/client/src/app/core/ui-services/poll.service.ts @@ -100,7 +100,10 @@ export abstract class PollService { * TODO: Should be given by the server, and editable. For now they are hard * coded */ - private _specialPollVotes: [number, string][] = [[-1, 'majority'], [-2, 'undocumented']]; + private _specialPollVotes: [number, string][] = [ + [-1, 'majority'], + [-2, 'undocumented'] + ]; /** * getter for the special vote values diff --git a/client/src/app/core/ui-services/search.service.ts b/client/src/app/core/ui-services/search.service.ts index 850e3922d..39186027e 100644 --- a/client/src/app/core/ui-services/search.service.ts +++ b/client/src/app/core/ui-services/search.service.ts @@ -209,7 +209,7 @@ export class SearchService { .map(searchModel => { const results = this.viewModelStore .getAll(searchModel.collectionString) - .map(x => x as (BaseViewModel & Searchable)) + .map(x => x as BaseViewModel & Searchable) .filter(model => !searchOnlyById ? model.id === dedicatedId || diff --git a/client/src/app/shared/components/sorting-tree/sorting-tree.component.ts b/client/src/app/shared/components/sorting-tree/sorting-tree.component.ts index d8340b574..888e64869 100644 --- a/client/src/app/shared/components/sorting-tree/sorting-tree.component.ts +++ b/client/src/app/shared/components/sorting-tree/sorting-tree.component.ts @@ -69,7 +69,10 @@ export class SortingTreeComponent implemen /** * The tree control */ - public treeControl = new FlatTreeControl>(node => node.level, node => node.expandable); + public treeControl = new FlatTreeControl>( + node => node.level, + node => node.expandable + ); /** * Source for the tree diff --git a/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts b/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts index 362f986cb..764d702e4 100644 --- a/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts +++ b/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts @@ -312,7 +312,10 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit if (this.isSortMode) { this.isSortMode = false; this.listOfSpeakersRepo - .sortSpeakers(this.viewListOfSpeakers, this.listElement.sortedItems.map(el => el.id)) + .sortSpeakers( + this.viewListOfSpeakers, + this.listElement.sortedItems.map(el => el.id) + ) .catch(this.raiseError); } } diff --git a/client/src/app/site/assignments/components/assignment-detail/assignment-detail.component.ts b/client/src/app/site/assignments/components/assignment-detail/assignment-detail.component.ts index 704f41a5f..7af504596 100644 --- a/client/src/app/site/assignments/components/assignment-detail/assignment-detail.component.ts +++ b/client/src/app/site/assignments/components/assignment-detail/assignment-detail.component.ts @@ -494,7 +494,10 @@ export class AssignmentDetailComponent extends BaseViewComponent implements OnIn */ public onSortingChange(listInNewOrder: ViewAssignmentRelatedUser[]): void { this.repo - .sortCandidates(listInNewOrder.map(relatedUser => relatedUser.id), this.assignment) + .sortCandidates( + listInNewOrder.map(relatedUser => relatedUser.id), + this.assignment + ) .catch(this.raiseError); } diff --git a/client/src/app/site/motions/models/view-category.ts b/client/src/app/site/motions/models/view-category.ts index f55c649c1..cd0152e47 100644 --- a/client/src/app/site/motions/models/view-category.ts +++ b/client/src/app/site/motions/models/view-category.ts @@ -72,7 +72,10 @@ export class ViewCategory extends BaseViewModel implements CategoryTit public formatForSearch(): SearchRepresentation { return { - properties: [{ key: 'Name', value: this.name }, { key: 'Prefix', value: this.prefix }], + properties: [ + { key: 'Name', value: this.name }, + { key: 'Prefix', value: this.prefix } + ], searchValue: [this.name, this.prefix] }; } diff --git a/client/src/app/site/motions/services/motion-csv-export.service.ts b/client/src/app/site/motions/services/motion-csv-export.service.ts index 257ddd22b..4d15aa8e0 100644 --- a/client/src/app/site/motions/services/motion-csv-export.service.ts +++ b/client/src/app/site/motions/services/motion-csv-export.service.ts @@ -100,7 +100,8 @@ export class MotionCsvExportService { const properties = sortMotionPropertyList(['identifier', 'title'].concat(contentToExport)); const exportProperties: ( | CsvColumnDefinitionProperty - | CsvColumnDefinitionMap)[] = properties.map(option => { + | CsvColumnDefinitionMap + )[] = properties.map(option => { if (option === 'recommendation') { return { label: 'recommendation', diff --git a/client/src/app/site/topics/models/view-topic.ts b/client/src/app/site/topics/models/view-topic.ts index 0643dba2e..42593b26a 100644 --- a/client/src/app/site/topics/models/view-topic.ts +++ b/client/src/app/site/topics/models/view-topic.ts @@ -24,7 +24,10 @@ export class ViewTopic extends BaseViewModelWithAgendaItemAndListOfSpeakers