diff --git a/client/src/app/core/services/operator.service.ts b/client/src/app/core/services/operator.service.ts index a999a76b4..2201ed7aa 100644 --- a/client/src/app/core/services/operator.service.ts +++ b/client/src/app/core/services/operator.service.ts @@ -174,7 +174,8 @@ export class OperatorService extends OpenSlidesComponent { */ private updatePermissions(): void { this.permissions = []; - if (!this.user) { + // Anonymous or users in the default group. + if (!this.user || this.user.groups_id.length === 0) { const defaultGroup = this.DS.get('users/group', 1); if (defaultGroup && defaultGroup.permissions instanceof Array) { this.permissions = defaultGroup.permissions; diff --git a/client/src/app/shared/components/choice-dialog/choice-dialog.component.ts b/client/src/app/shared/components/choice-dialog/choice-dialog.component.ts index e509c1744..9ee58b9ee 100644 --- a/client/src/app/shared/components/choice-dialog/choice-dialog.component.ts +++ b/client/src/app/shared/components/choice-dialog/choice-dialog.component.ts @@ -1,5 +1,6 @@ import { Component, Inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; + import { Displayable } from 'app/shared/models/base/displayable'; import { Identifiable } from 'app/shared/models/base/identifiable'; diff --git a/client/src/app/shared/components/legal-notice-content/legal-notice-content.component.ts b/client/src/app/shared/components/legal-notice-content/legal-notice-content.component.ts index 8fc1eb41a..2592e844e 100644 --- a/client/src/app/shared/components/legal-notice-content/legal-notice-content.component.ts +++ b/client/src/app/shared/components/legal-notice-content/legal-notice-content.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit } from '@angular/core'; + import { TranslateService } from '@ngx-translate/core'; + import { LoginDataService } from '../../../core/services/login-data.service'; import { environment } from 'environments/environment'; import { HttpService } from '../../../core/services/http.service'; diff --git a/client/src/app/shared/components/logo/logo.component.ts b/client/src/app/shared/components/logo/logo.component.ts index 92285586d..dfd112295 100644 --- a/client/src/app/shared/components/logo/logo.component.ts +++ b/client/src/app/shared/components/logo/logo.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; + import { MediaManageService } from '../../../site/mediafiles/services/media-manage.service'; /** diff --git a/client/src/app/shared/components/os-sort-filter-bar/os-sort-filter-bar.component.ts b/client/src/app/shared/components/os-sort-filter-bar/os-sort-filter-bar.component.ts index bb2f0c157..c97e869a6 100644 --- a/client/src/app/shared/components/os-sort-filter-bar/os-sort-filter-bar.component.ts +++ b/client/src/app/shared/components/os-sort-filter-bar/os-sort-filter-bar.component.ts @@ -1,5 +1,6 @@ import { Input, Output, Component, ViewChild, EventEmitter } from '@angular/core'; import { MatBottomSheet } from '@angular/material'; + import { TranslateService } from '@ngx-translate/core'; import { BaseViewModel } from '../../../site/base/base-view-model'; diff --git a/client/src/app/shared/components/privacy-policy-content/privacy-policy-content.component.ts b/client/src/app/shared/components/privacy-policy-content/privacy-policy-content.component.ts index effb17627..23da96abe 100644 --- a/client/src/app/shared/components/privacy-policy-content/privacy-policy-content.component.ts +++ b/client/src/app/shared/components/privacy-policy-content/privacy-policy-content.component.ts @@ -1,7 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { LoginDataService } from '../../../core/services/login-data.service'; + import { TranslateService } from '@ngx-translate/core'; +import { LoginDataService } from '../../../core/services/login-data.service'; + /** * Shared component to hold the content of the Privacy Policy. * Used in login and site container. diff --git a/client/src/app/shared/components/projection-dialog/projection-dialog.component.ts b/client/src/app/shared/components/projection-dialog/projection-dialog.component.ts index 024c3e552..740d21548 100644 --- a/client/src/app/shared/components/projection-dialog/projection-dialog.component.ts +++ b/client/src/app/shared/components/projection-dialog/projection-dialog.component.ts @@ -1,5 +1,6 @@ import { Component, Inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; + import { ProjectorElementBuildDeskriptor } from 'app/site/base/projectable'; import { DataStoreService } from 'app/core/services/data-store.service'; import { Projector, IdentifiableProjectorElement } from 'app/shared/models/core/projector'; diff --git a/client/src/app/shared/components/projector-button/projector-button.component.ts b/client/src/app/shared/components/projector-button/projector-button.component.ts index 4696d9d04..be596fed8 100644 --- a/client/src/app/shared/components/projector-button/projector-button.component.ts +++ b/client/src/app/shared/components/projector-button/projector-button.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; + import { Projectable, ProjectorElementBuildDeskriptor } from 'app/site/base/projectable'; import { ProjectionDialogService } from 'app/core/services/projection-dialog.service'; import { ProjectorService } from '../../../core/services/projector.service'; diff --git a/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts b/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts index a668d3999..f69ace008 100644 --- a/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts +++ b/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts @@ -1,9 +1,11 @@ import { Component, OnInit, Input, ViewChild, OnDestroy } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; -import { Subject, ReplaySubject, BehaviorSubject, Subscription } from 'rxjs'; import { MatSelect } from '@angular/material'; + +import { Subject, ReplaySubject, BehaviorSubject, Subscription } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; + import { Selectable } from '../selectable'; /** diff --git a/client/src/app/shared/components/sorting-list/sorting-list.component.ts b/client/src/app/shared/components/sorting-list/sorting-list.component.ts index d15be8d8d..1ad57045f 100644 --- a/client/src/app/shared/components/sorting-list/sorting-list.component.ts +++ b/client/src/app/shared/components/sorting-list/sorting-list.component.ts @@ -1,9 +1,11 @@ import { Component, OnInit, Input, Output, EventEmitter, ContentChild, TemplateRef, OnDestroy } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; + +import { TranslateService } from '@ngx-translate/core'; +import { Observable, Subscription } from 'rxjs'; + import { Selectable } from '../selectable'; import { EmptySelectable } from '../empty-selectable'; -import { Observable, Subscription } from 'rxjs'; /** * Reusable Sorting List diff --git a/client/src/app/shared/directives/perms.directive.ts b/client/src/app/shared/directives/perms.directive.ts index 5cb632352..cea8c0504 100644 --- a/client/src/app/shared/directives/perms.directive.ts +++ b/client/src/app/shared/directives/perms.directive.ts @@ -1,4 +1,6 @@ -import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; +import { Directive, Input, TemplateRef, ViewContainerRef, OnDestroy, OnInit } from '@angular/core'; + +import { Subscription } from 'rxjs'; import { OperatorService, Permission } from 'app/core/services/operator.service'; import { OpenSlidesComponent } from 'app/openslides.component'; @@ -13,7 +15,7 @@ import { OpenSlidesComponent } from 'app/openslides.component'; @Directive({ selector: '[osPerms]' }) -export class PermsDirective extends OpenSlidesComponent { +export class PermsDirective extends OpenSlidesComponent implements OnInit, OnDestroy { /** * Holds the required permissions the access a feature */ @@ -46,6 +48,8 @@ export class PermsDirective extends OpenSlidesComponent { */ private complement: boolean; + private operatorSubscription: Subscription | null; + /** * Constructs the directive once. Observes the operator for it's groups so the * directive can perform changes dynamically @@ -60,13 +64,21 @@ export class PermsDirective extends OpenSlidesComponent { private operator: OperatorService ) { super(); + } + public ngOnInit(): void { // observe groups of operator, so the directive can actively react to changes - this.operator.getObservable().subscribe(content => { + this.operatorSubscription = this.operator.getObservable().subscribe(() => { this.updateView(); }); } + public ngOnDestroy(): void { + if (this.operatorSubscription) { + this.operatorSubscription.unsubscribe(); + } + } + /** * Comes directly from the view. * The value defines the requires permissions as an array or a single permission. diff --git a/client/src/app/shared/directives/resized.directive.ts b/client/src/app/shared/directives/resized.directive.ts index fde85f36a..b513a305c 100644 --- a/client/src/app/shared/directives/resized.directive.ts +++ b/client/src/app/shared/directives/resized.directive.ts @@ -1,4 +1,5 @@ import { OnInit, ElementRef, Directive, Input } from '@angular/core'; + import { ResizeSensor } from 'css-element-queries'; import { Subject } from 'rxjs'; diff --git a/client/src/app/site/users/components/password/password.component.html b/client/src/app/site/users/components/password/password.component.html index 15d02fad3..f02286d5a 100644 --- a/client/src/app/site/users/components/password/password.component.html +++ b/client/src/app/site/users/components/password/password.component.html @@ -23,6 +23,7 @@ placeholder="{{ 'New password' | translate }}" /> diff --git a/client/src/app/site/users/components/password/password.component.scss b/client/src/app/site/users/components/password/password.component.scss index bc76a27e2..af694393c 100644 --- a/client/src/app/site/users/components/password/password.component.scss +++ b/client/src/app/site/users/components/password/password.component.scss @@ -1,3 +1,7 @@ mat-form-field { width: 100%; } + +.pointer { + cursor: pointer; +}